David H
13 Dec 05, 01:17 PM
First Post. I don't think this is really the right spot to put this question but I couldn't find anywhere better.
Procedures in the Logic Engine they seem to be order sensitive.
Below I have attached code segments. While they're essentially the same thing. One will work and one won't work.
Is this a known issue? Got a good explanation?
I would appreciate any input as it was a pain in the behind to work out what was going wrong in the code i was debugging.
[edit] altered the Group Addresses so they were the same and fixed formatting.
{Procedure Works}
procedure DemoWorks;
begin
once(GetLightingState(1)) then
SetLightingState(3,ON);
once(GetLightingState(2)=OFF) then
SetLightingState(3,OFF);
end;
{Procedure Fails}
procedure DemoFails;
begin
once(GetLightingState(2)=OFF) then
SetLightingState(3,OFF);
once(GetLightingState(1)) then
SetLightingState(3,ON);
end;
Procedures in the Logic Engine they seem to be order sensitive.
Below I have attached code segments. While they're essentially the same thing. One will work and one won't work.
Is this a known issue? Got a good explanation?
I would appreciate any input as it was a pain in the behind to work out what was going wrong in the code i was debugging.
[edit] altered the Group Addresses so they were the same and fixed formatting.
{Procedure Works}
procedure DemoWorks;
begin
once(GetLightingState(1)) then
SetLightingState(3,ON);
once(GetLightingState(2)=OFF) then
SetLightingState(3,OFF);
end;
{Procedure Fails}
procedure DemoFails;
begin
once(GetLightingState(2)=OFF) then
SetLightingState(3,OFF);
once(GetLightingState(1)) then
SetLightingState(3,ON);
end;