>I have the following code
>
>
>SELECT sum(pinfo.workhour) from pinfo ;
>where person.personid = pinfo.personid into array result
>testresult = VARTYPE(result)
>IF VARTYPE(result) # 'U' OR VARTYPE(result) # 'L'
> .pf1.p1.txtdisplaycurrentwrkhrs.value = result[1,1]
> .pf1.p1.txtdisplaycurrentwrkhrs.refresh()
>ELSE
> .pf1.p1.txtdisplaycurrentwrkhrs.value = 0.0
> .pf1.p1.txtdisplaycurrentwrkhrs.refresh()
>ENDIF
>RELEASE result
>
>
>When I run the program, I get an error on 4th line as follows:
>
>File "result.prg" does not exist.
>
>
>the variable called "testresult" is returning a 'U', but when the "result" array is evaluated on 4th line I get the above mentioned error. Can some clue me in on this.
>
>Thanks
Nick,
Try dimensioning the array prior to the SQL Select. I think that should fix it, but it'd be helpful for you to check either _TALLY or the array size prior to entering the IF/ELSE/ENDIF block.
George
Ubi caritas et amor, deus ibi est