Is this code correct for the job

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by xrmichael, Feb 9, 2008.

  1. xrmichael

    xrmichael

    Joined:
    Nov 20, 2006
    Messages:
    113
    Likes Received:
    1
    Location:
    uk
    I want an array that reads a level/temp every 60s then on the 61st read shunts all array values to the left and keeps shunting unittill the logic restarts is the best way or is there a better array like stacked array that does the shunt auto ?


    For counter1 := 1 to 60 do
    StatsTemp01hr[counter1] := round(getunitparameter(254, 3, ptTemperature));
    counter1 := counter1+1;
    Delay(60);
    if counter1 = 60 then begin
    For counter4 := 1 to 59 do
    StatsTemp01hr[counter2] := StatsTemp01hr[counter3];
    counter2:=counter2+1;
    counter3:=counter3+1;
    counter4:=counter4+1;
    if counter4 = 59 then
    StatsTemp01hr[60] := round(getunitparameter(254, 3, ptTemperature));
    counter1:= 59;
    counter2:= 1;
    counter3:= 2;
    end
     
    xrmichael, Feb 9, 2008
    #1
  2. xrmichael

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,420
    Likes Received:
    62
    Location:
    Adelaide
    I haven't checked through your code, but perhaps you could go back a step and tell us what you're trying to achieve with it... there may be a better way.

    Nick
     
    NickD, Feb 10, 2008
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.