PDA

View Full Version : if(blablabla) and (blablabla)?



TheWeedKiller
07-30-2003, 05:05 PM
I used to do some programming in other languages and I could combine if statements like:
if(number = 5) and (number2 = 4)
if(variable = 26) or (size < 3)

Can I do this in lscript? If so with what character would I join the two expressions with?

TheWeedKiller
07-30-2003, 05:12 PM
sorry i found the anwser please delete this thread

stib
07-30-2003, 09:45 PM
and the answer was...?

TheWeedKiller
07-30-2003, 09:49 PM
lscript can do it, here is the syntax:
if((variable1 = 6) && (variable2 = 3))

Tom Speed
07-30-2003, 11:23 PM
Hi,

That's actualy wrong for the expression you're doing :)

With one '=' sign you're assigning a variable a value instead of checking it's value:

To LScript:

if(variable1=6 && variable2=3)

Would assign both variables their respective values, and both conditions would be TRUE, so the if() condition would always be satisfied.

The correct way in your sample is:

if(variable1==6 && variable2==3)

Cya!
Tom

TheWeedKiller
07-31-2003, 12:11 AM
yes you are right it should be 2 equal signs, i had mistyped it.