Alpha Video Training
Results 1 to 5 of 5

Thread: if then, else

  1. #1
    "Certified" Alphaholic richard2007's Avatar
    Real Name
    Richard Harris
    Join Date
    Sep 2007
    Location
    Ashford, Kent, UK
    Posts
    1,091

    Default if then, else

    i tried putting this in an 'if, then, else if' statement but it would not fire so i had to do individual statements.

    anyway, i cant figure out how to put in one more statement - if the value is anything else (other than those in the list) redirect to another page.

    Code:
    	dim ds as P
    	ds = e.DataSubmitted
    	
    	if ds.stage = "Client Added" then
    		e.url = "idd_create.a5w"
    	end if
    	
    	if ds.stage = "IDD Issued" .or. ds = "Fact Finding" then
    		e.url = "client1.a5w"
    	end if
    	
    	if ds.stage = "Recommendations" then
    		e.url = "adv_recs.a5w"
    	end if
    	
    	if ds.stage = "Select Case Manager" then
    		e.url = "nb_adviser.a5w"
    	end if
    			
    	if ds.stage = "Generate Compliance" then
    		e.url = "nb_preview.a5w"
    	end if
    			
    	if ds.stage = "Upload Documents" then
    		e.url = "nb_docs.a5w"
    	end if
    			
    	if ds.stage = "Create Tasks" then
    		e.url = "nb_products.a5w"
    	end if
    			
    	if ds.stage = "Submit Case" then
    		e.url = "nb_submit.a5w"
    	end if	
    		
    	if ds.stage = "Case Management" then
    		e.url = "st_caseoverview.a5w"
    	end if
    
           if ds.stage = anything else then redirect to another page

  2. #2
    Moderator Steve Workings's Avatar
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,596

    Default Re: if then, else

    Code:
    Select 
        case a
            do this
        case b
            do that
        case else
            do something else
    end select
    -Steve


  3. #3
    Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,827

    Default Re: if then, else

    If you want to use your IF statements, then just throw a line at the very top. If none of the IF statements are true, it will retain your default:

    e.url = "mydefault.a5w"
    ... everything else
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  4. #4
    "Certified" Alphaholic
    Real Name
    Gregg Schmidt
    Join Date
    Mar 2001
    Location
    Milwaukee
    Posts
    1,273

    Default Re: if then, else

    You didn't show us the code that didn't work as expected. Quite often, it's just a simple fix.
    I think the code here will do what you want.

    Code:
    	dim ds as P
    	ds = e.DataSubmitted
    	
    	if ds.stage = "Client Added" then
    		e.url = "idd_create.a5w"
    	
    	
    		elseif ds.stage = "IDD Issued" .or. ds = "Fact Finding" then
    		e.url = "client1.a5w"
    	
    	
    		elseif ds.stage = "Recommendations" then
    		e.url = "adv_recs.a5w"
    	
    	
    		elseif ds.stage = "Select Case Manager" then
    		e.url = "nb_adviser.a5w"
    	
    			
    		elseif ds.stage = "Generate Compliance" then
    		e.url = "nb_preview.a5w"
    
    			
    		elseif ds.stage = "Upload Documents" then
    		e.url = "nb_docs.a5w"
    	
    			
    		elseif ds.stage = "Create Tasks" then
    		e.url = "nb_products.a5w"
    
    			
    		elseif ds.stage = "Submit Case" then
    		e.url = "nb_submit.a5w"
    
    		
    		elseif ds.stage = "Case Management" then
    		e.url = "st_caseoverview.a5w"
    
    
    	             elseif ds.stage = {anything else} .or. 1=1 then
    		redirect to some other page
    	
    	end if

  5. #5
    "Certified" Alphaholic richard2007's Avatar
    Real Name
    Richard Harris
    Join Date
    Sep 2007
    Location
    Ashford, Kent, UK
    Posts
    1,091

    Default Re: if then, else

    thanks for all help. these help with other stuff as well.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •