 |
hub Newbie
Joined: 17 Mar 2005 Posts: 1
|
Posted: Mon Mar 21, 2005 6:59 am
variables and if and text |
Hi
I`ve little two problems and dont known how to do it please help:
1. To check that variable is true of course we use = to check that variable is not true we can use != or <>. When variable is some text to check we use =~{TEXT} but what I can check that variable is not the text in {}
2. This problem I thing is related with the first one. How can I use IF inside another IF. Version:
#if (@temp = 1) {#say yes} {#if (@temp2 = 1) {#say YES} {#say NO}}
doesnt work.
HUB
P.S.
Sorry about my english ;/ |
|
|
 |
Dharkael Enchanter

Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: Mon Mar 21, 2005 11:49 am |
1)
#var temp {Something}
#IF (!(@temp =~ {TEXT})) {#echo true} {#echo false}
The above code should echo true.
We just enclose the pattern matching expression in brackets () and then negate it using the negation operator !
2)
It does work:
#if (@temp = 1) is true
it says "yes"
#if (@temp = 1) is false and #if (@temp2 = 1) is true
it says "YES"
#if (@temp = 1) is false and #if (@temp2 = 1) is false
it says "NO"
This is correct, what is that you wished to do with nested IFs? |
|
_________________ -Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style." |
|
|
 |
|
|