SIOC Script modification

This is a new forum for the OC4BAv4.
Post Reply
Alpin-Flier
Posts: 46
Joined: Sun May 24, 2015 2:59 pm

SIOC Script modification

Post 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
mvr1918
Site Admin
Posts: 1709
Joined: Thu Aug 30, 2012 3:35 pm

Re: SIOC Script modification

Post 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.
Post Reply