#75160 - 2003-05-23 09:26 AM
Adding values
|
attiahia
Hey THIS is FUN
Registered: 2000-03-27
Posts: 268
|
Why I can not add $PFU values (cumulative) ?
$X=0 $AVRG=0 $Opn=Open(1,"D:\Task.txt",2) DO $Red=ReadLine(1) $Red2 = LTRIM("$Red") $B=INSTR($Red2, "PFU") $PFU=Substr($Red2,$B,7) ? $PFU (first value for $PFU=90) $AVRG=$AVRG + $PFU (now $AVRG should be 0 + 90= 90 but it still 0) $X=$X+1 Until $X=5 $C=Close(1)
I tried the same thing with VAL but also did not work. $AVRG=$AVRG + VAL(“$PFU”)
Please Help. Thank you.
|
Top
|
|
|
|
#75163 - 2003-05-23 09:55 AM
Re: Adding values
|
attiahia
Hey THIS is FUN
Registered: 2000-03-27
Posts: 268
|
I am confused because this was working fine with me long time ago, I do not know what happen? Following is example for the txt file I read from and for the output I got. Red2=Today=2003/05/22 Time=11:51:50 PFU=90 Today=2003/05/22 Time=11:51:50 _PFU=90_ AVRG=0
Red2=Today=2003/05/22 Time=11:52:02 PFU=140 Today=2003/05/22 Time=11:52:02 _PFU=140_ AVRG=0
Red2=Today=2003/05/22 Time=11:52:18 PFU=160 Today=2003/05/22 Time=11:52:18 _PFU=160_ AVRG=0
Note: I got 0 result for $pfu = val( substr($red2,$b,7) ) I am using Kix32 V 4.20.0.0 Thank you.
|
Top
|
|
|
|
#75167 - 2003-05-23 10:22 AM
Re: Adding values
|
attiahia
Hey THIS is FUN
Registered: 2000-03-27
Posts: 268
|
Give me some more time I think I will know the reason. substr($red2,$b,7) include string + integer
|
Top
|
|
|
|
#75168 - 2003-05-23 10:27 AM
Re: Adding values
|
attiahia
Hey THIS is FUN
Registered: 2000-03-27
Posts: 268
|
I posted my reply before I see yours but I do not know how yours appear first? I think because you have stars while I do not. Thank you very much.
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 248 anonymous users online.
|
|
|