|
Oracle Apprentice
Joined: 29 May 2002 Posts: 121
|
Posted: Sat Sep 28, 2002 8:31 pm
Booleans in #If statement |
I have this condition that is always true. Does anyone know why this is happening?
#IF (@VFirstword = (a | an | some)) {Do something when true} {Do something when false} |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sat Sep 28, 2002 8:53 pm |
It happens because of incorrect syntax. Try this instead:
#IF ((@VFirstword = "a") or (@VFirstword = "an") or (@VFirstword = "some")) {Do something when true} {Do something when false}
Also, an alternative, shorter way of doing it is:
#IF ((@VFirstword =~ "{a|an|some}")) {Do something when true} {Do something when false}
Kjata |
|
|
|
Oracle Apprentice
Joined: 29 May 2002 Posts: 121
|
Posted: Sat Sep 28, 2002 9:40 pm |
Thank you, that works great.
|
|
|
|
|
|