Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Please confirm EXECSCRIPT() bug
Message
De
08/12/2003 13:08:54
 
 
À
08/12/2003 12:09:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00856725
Message ID:
00856877
Vues:
24
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform