Page 1 of 1

Seqhour, get values for 24h

Posted: Fri Jan 19, 2018 1:26 pm
by Armond
I want to have the total rain for the last 24h, that means 24 values. But how do I continue after the letter z?

[seqhour1_rain0_total_mm#AE], [seqhour1_rain0_total_mm#FJ], [seqhour1_rain0_total_mm#KO], [seqhour1_rain0_total_mm#PT][seqhour1_rain0_total_mm#UY], ????????

seqhour1_rain0_total_mm: 0.00_0.00_0.00_0.00_0.33_0.30_0.69_0.00_0.0
ABCDEFGHIJKLMNOPQRSTUVWXYZ????????????????

Re: Seqhour, get values for 24h

Posted: Fri Jan 19, 2018 2:16 pm
by wvdkuil
Armond wrote: Fri Jan 19, 2018 1:26 pm I want to have the total rain for the last 24h, that means 24 values. But how do I continue after the letter z?

[seqhour1_rain0_total_mm#AE], [seqhour1_rain0_total_mm#FJ], [seqhour1_rain0_total_mm#KO], [seqhour1_rain0_total_mm#PT][seqhour1_rain0_total_mm#UY], ????????

seqhour1_rain0_total_mm: 0.00_0.00_0.00_0.00_0.33_0.30_0.69_0.00_0.0
ABCDEFGHIJKLMNOPQRSTUVWXYZ????????????????
You can't do it that way as the numbers can be different length and there are not always at least 24 values

Code: Select all

0.00 0.00 0.00 0.00 0.33 0.30 0.69 0.00 0.0     or
0.00 99.10 0.00 11.00 0.33 
The seq variables are an array and should be used in PHP with an

Code: Select all

$array = explode (' ',$uploaded-value);
Then you can address the values individually with

Code: Select all

        for ($n=0;$n <= 23; $n++)      // first - 23 hours array
             {  if (isset ($arr_rain[$n]) ) 
                     {  $countRain = $countRain + 1.0*$arr_rain[$n]; }}
You have to check if the hour-value exists as after a restart it takes 24+1 hour to fully populate the 24 entries you need.

Wim

Re: Seqhour, get values for 24h

Posted: Mon Jan 22, 2018 11:49 am
by Armond
Thanks for the answer. I use asp.