Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Please confirm EXECSCRIPT() bug
Message
From
08/12/2003 12:10:23
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00856725
Message ID:
00856859
Views:
21
Please confirm:

In my sample code

cres = EXECSCRIPT('x=y') returns .T.
cres = EXECSCRIPT('x') returns 'Do not touch'

Do you REALLY expect that execscript() returns different results on
different errors ?

>>Title
>> Some errors change EXECSCRIPT() return value
>>
>>Repro:
>>
>>
>>PROCEDURE muutsead
>>cres = 'Do not touch'
>>ON ERROR  seterror()
>>cres = EXECSCRIPT('x=y')
>>MESSAGEBOX(cres)
>>
>>PROCEDURE seterror
>>RETURN TO muutsead
>>ENDPROC
>>
>>
>>Result observed:
>>
>>.T.
>>
>>Result expected
>>
>>Do not touch
>>
>>Platform:
>>
>>VFP 7, 8
>>
>>Note
>>
>>if EXECSCRIPT() line is changed to
>>lres = execscript( 'x')
>> expected result is returned !
>>
>>Is this VFP bug ?
>
>No, this has nothing to do with Execscript.
>The execscript returns .T., but the messagebox will transform the expression to character.
>For instance the following statements do work fine (tested in VFP8)
>
>MESSAGEBOX(.T.)
>MESSAGEBOX(DATE())
>
>
>If I change the call of the messagebox I get this:
>
>MESSAGEBOX(vartype(cres)) &&L
>MESSAGEBOX(ALLTRIM(cres)) &&Error is fired
>
>
>hth,
Andrus
Previous
Reply
Map
View

Click here to load this message in the networking platform