Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Please confirm EXECSCRIPT() bug
Message
From
08/12/2003 13:08:54
 
 
To
08/12/2003 12:09:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00856725
Message ID:
00856877
Views:
25
Andrus, the results that you are seeing are exactly as expected as VIV correctly pointed out. See code example below with the equivalent function call.

cres = EXECSCRIPT('x=y') is a perfectly valid script which is returning .t. since the script does not directly return a value.

cres = EXECSCRIPT('x') generates a runtime error which is picked up by your error handler which effectively skips the line with the error which is why you do not see it setting a new value to cres.
cres = "Do Not Touch"
x = 1 
y = 1 
ON ERROR  seterror()
cres = EXECSCRIPT('x=y')
MESSAGEBOX(cres)

*!* is the equivalent to 
cres = "Do Not Touch"
x = 1 
y = 1 
ON ERROR  seterror()
cres = set_xtoY()
MESSAGEBOX(cres)


FUNCTION set_xtoY
   x = y
   return .t.
ENDFUNC


PROCEDURE seterror
   RETURN TO muutsead
ENDPROC
Previous
Reply
Map
View

Click here to load this message in the networking platform