testing multiple statements?

1 view
Skip to first unread message

Eric F.

unread,
Aug 3, 2011, 5:01:11 AM8/3/11
to jacl-discuss
Sorry to ask so many questions... I've read the manual, but can't find
any answer.

in a function, it seems it's possible to test for "OR", like this:

if compass == south : compass == in

but I'd also like to test for "AND", for example if it was &&:

{movement
if compass == south && Margareth hasnt TALKED_TO
write "Margareth say : « Hey don't leave now! »^"
return
else
return false
endif
}

but it's not working like that.
I had to write this, which is much more complicated:

{movement
if compass == south
if Margareth hasnt TALKED_TO
write "Margareth say : « Hey don't leave now! »^"
return
else
return false
endif
else
return false
endall
}


Thomas Schwarz

unread,
Aug 3, 2011, 5:59:48 AM8/3/11
to jacl-d...@googlegroups.com
Just use

ifall compass == south : compass == in

That does what you want.

Regards
thomas

Eric F.

unread,
Aug 3, 2011, 6:05:46 PM8/3/11
to jacl-discuss
It was in the reference card, but I've missed it. Thank you Thomas!
Reply all
Reply to author
Forward
0 new messages