PDA

View Full Version : sioc programming question: IF..AND..



stabell
10-21-2008, 04:42 AM
Hello!
If I want to say "if a>0 AND b=5, then c=0",
can I write

Var 2000
(
IF a>0
b=5
(
c=0
)
)

or do I have to use the "AND" word?
I receive errors when trying to say " IF a>0 AND b=5 "

stabell
10-21-2008, 05:42 AM
... or,
what to write if I want to say

IF a>5 OR a<-5

..

barkay
10-21-2008, 05:51 AM
Hi,

As fas as I remeber you have to write a new condition using ELSE IF. Try using the own program within SIOC to wirte instead of trying on the .txt format. You can find all functions in a very good GUI there.

Best Regards,

barkay

GaryC
10-21-2008, 06:06 AM
Hi

Try this...

Var 1 name a
Var 2 name b
var 3 name c

{
C0 = &a > 0
C1 = &b = 5
IF C0 AND C1
{
&c = 0
}

}

stabell
10-21-2008, 06:39 AM
thank you som much, pro's!
I see; the AND and OR is to be used only with the C's,
true or not trues.
I will certainly try that!

GaryC
10-21-2008, 06:57 AM
Hi

This is a better way of writting it the other way was to show the use of Internal Variables.

Var 1 name a
Var 2 name b
var 3 name c

{
IF &a > 0
{
IF &b = 5
{
&c = 0
}
}
}

kiek
10-21-2008, 02:14 PM
http://www.lekseecon.nl/howto.html#internalVars

cheers,
Nico