|
Virus Wanderer
Joined: 29 Jun 2002 Posts: 69 Location: USA
|
Posted: Tue Jul 30, 2002 2:02 am
#IF |
I am having a problem with the following.
If I do a:
#IF (T=%upper(t)) {#Sh Yes} {#SH No}
I get: Yes
If I do a:
#IF (@CONT) {#SH Yes} {#SH No} - And the variable @CONT exists and is 1, I get: Yes
Now if I do a:
#IF (T=%upper(t) and @CONT) {#SH Yes} {#SH No}
I get a: No.
Can soemoen please help?
Richard Powell
Mux Alias: Virus
2796 Wizard Staff
64.89.10.1 port 2796
Rich@gigdev.com |
|
|
|
Virus Wanderer
Joined: 29 Jun 2002 Posts: 69 Location: USA
|
Posted: Tue Jul 30, 2002 2:17 am |
I just realized what I did. In the examples I added a space. May have something to do with it. Also, I used code similar to:
#IF (%1=%upper(%1)&@{CON%1}) {#SH Yes} {#SH No}
Well the problem with that was that I was typing it in as lowercase the whole time. Now, I have a list set up in CONS. Is there a way to check to see if a string is part of the list? IE If %1 is in list CONS then?
Heres an example. If my list is:
HI|DT|FS|RE|AF|aa|ty|ju|ME|ma
and I do a #IF aa is part of list cons then.?
Richard Powell
Mux Alias: Virus
2796 Wizard Staff
64.89.10.1 port 2796
Rich@gigdev.com |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Tue Jul 30, 2002 2:44 am |
First thing of note, there have been some reported problems of order of ops not working correctly in some syntaxes. I wouldn't know about these thing because years of programming taught me not trust order of ops with logic tests, it also taught me that I don't always think logically and must be particular to assure the computer is thinking the same way I am. I always explicitly define the order using paranthesis for all logic things and it serves me well.
#IF (("%1"=%upper("%1"))&(@{CON%1})) {#SH Yes} {#SH No}
As to the list question you can use the %ismember function. It is a case sensitive function so if you need it to not be then use %upper on both the search value and the list. |
|
|
|
|
|