Page 1 of 1

SIOC Script modification

Posted: Sat May 14, 2016 1:20 pm
by Alpin-Flier
Hi all

I'm actually working on my OCP4NGX_PP_v4.0.ssi script, but have little experience. Now I have a basic question. Very often I find definitions like this:

//
Var 0431, name gear_0_l_l, Link IOCARD_OUT, Device 31, Output 12 // Nose Gear Green LED
Var 1339, name gear_0_l, static // Nose Gear Green state
{
CALL &nosegsub
}
Var 0432, name nosegsub, Link SUBRUTINE
{
IF &gear_0_l = 0
{
&gear_0_l_l = 0
}
ELSE
{
&gear_0_l_l = 1
}
}
//

But I have learned from the SIOC presentation (at least I think so), that variables may also appear on the right side of the = sign. So I think the following much shorter script should do the same job:

//
Var 0431, name gear_0_l_l, Link IOCARD_OUT, Device 31, Output 12 // Nose Gear Green LED
Var 1339, name gear_0_l, static // Nose Gear Green state
{
&gear_0_l_l = &gear_0_l
}
//

Is this correct or bloody nonsense? Thanks for infos.

Urs

Re: SIOC Script modification

Posted: Tue May 17, 2016 4:01 pm
by mvr1918
There is a reason why the SUBRUTINE call is in the code.

It is OK to have variables on both sides of =.

There are a lot of ways to write the script. To be honest I do not remember why I used my code and not the simpler way you suggest.

You will get the answer if you try it.