Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IF and ELSE statement

Status
Not open for further replies.

akar33

Programmer
Dec 13, 2004
39
US
Hello,
I am trying to make the following if and else statement work as follows. Actual value (field name TEST) is String.

Actual Value (TEST) Converted Value
abc 11
xyz 12
bab 23
13 ERROR

else
whatever is in the field TEST

Thanks

 
The Select control structure would be cleaner for this:

select {table.test}
case "abc" : "11"
case "xyz" : "12"
case "bab" : "23"
case "13" : "ERROR"
default : {table.test}

~Brian
 
Hello!
I would agree with Brian on this...that Select/Case is better for this type of selection...
It is possible to use Nested If/Then/Else but the process of writting this is tedious and will take longer that the nice Case select listed above!
Boni
:)

Boni J. Rychener
Programmer
boni@hammerman.com
Hammerman Associates, Inc.
 
Thanks Brian, you can tell new to crystal, used select in C++ but never thought of using in crystal :)



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top