PDA

View Full Version : Please help with Logic- I won't ask after this = Honest


mikegriff
04 Jul 05, 09:25 AM
{Mike in from Comfort}
once (GetLightingLevel("Mike") = 64) and
(GetLightingLevel("DownStairs Counter") = 0%) then
begin
SetTriggerLevel("Downstairs", 100%);
LightLevel := PercentToLevel(GetLightingLevel("DownStairs Counter")) ;
LightLevel := LightLevel + 1;
SetLightingLevel("DownStairs Counter", LevelToPercent(LightLevel), "0s");
end;

I'm trying to increment a lighting level by 1
I need to do this so that my comfort system counters can be updated

all I get is this error
Error C1025 at line 32:65 - Error in type of standard function parameter


I have read the help file HONEST but I cant seem to find a way of putting a variable into a level :(

Also the fact that Logic keeps reporting levels in percentage

I would really like to use all 255 levels
and I seem to rememnber that percentage by its very nature rounds up or down some of the 255 levels

Help please - once cured I should be able to sort out the rest
thanks in advance
Mike

Darren
04 Jul 05, 11:58 AM
LightLevel := PercentToLevel(GetLightingLevel("DownStairs Counter")) ;
The GetLightingLevel returns a level from 0 to 255, not a %, hence you do not need the PercentToLevel function.
SetLightingLevel("DownStairs Counter", LevelToPercent(LightLevel), "0s");
The SetLightingLevel takes a level as 0 to 255, not percent, so you do not need the LevelToPercent.[/QUOTE]
all I get is this error
Error C1025 at line 32:65 - Error in type of standard function parameter
You will need to tell us exectly where in your code this is.

mikegriff
04 Jul 05, 06:28 PM
I've taken out the % stuff, as it was showing in % added it in case that was causing the error

Found my mistake after sorrecting this
I was declaring
LightLevel, Threshold : real;
instead of
LightLevel, Threshold : integer;

Thanks for your help
Mike