Normal Topic Testing data entry (Read 2834 times)
Nancy
Member
*
Offline


No personal text

Posts: 9
Location: Pittsburgh
Joined: Feb 9th, 2006
Testing data entry
May 22nd, 2006 at 6:47pm
Print Post Print Post  
I want to test data entry against some codes that I could Xlookup for their description; however, i bomb out in the middle of my If Result = 1;2;3....statement..any hints?



If @IsBlank(RESULT) then
     {
     RESULT =
     RESULTDESC =
     }
Else
     If Result = 1;2;3;4;5;6;7;8;9;10;11;12;5a;7a;7b;
     {
           RESULTDESC = @XLOOKUP(D:\Sesame\Data\Result Codes.db, RESULT, RESULT CODES!RESULT CODE, RESULT DESCRIPTION)
     }
     Else
     {
           @MsgBox(Data needs to be null or a valid DISPOSITION CODE, 1;2;3;4;5;5a;6;7;7a;7b;8;9;10;11;12., , )
     }
Roll Eyes
  
Back to top
 
IP Logged
 
Forum Admin
YaBB Administrator
*****
Offline



Posts: 44
Joined: Jan 1st, 2001
Re: Testing data entry
Reply #1 - May 22nd, 2006 at 6:52pm
Print Post Print Post  
Nancy,

Please post in the General Discussion Board. The Programming Examples Board is for working SBasic code that others can use.

Thanks!
  

-----&&Erika Yoxall&&Forum Administrator
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Testing data entry
Reply #2 - May 22nd, 2006 at 7:10pm
Print Post Print Post  
Hello Nancy,

Code
Select All
If Result = 1;2;3;4;5;6;7;8;9;10;11;12;5a;7a;7b; 



is not a valid SBasic statement. You can do this compare several ways.

One way is to use Or to string together multiple conditionals. Ex To see if Result is a 1, 2 or 3

Code
Select All
If((Result = "1") Or (Result = "2") Or (Result = "3"))  



Another way is to use @SearchStringArray() to compare the field against a list of good values. Ex

Code
Select All
If @Len(@SearchStringArray(Result, "1;2;3;4;5;6;7;8;9;10;11;12;5a;7a;7b")) > 0 Then 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged