Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Compile error with EXECSCRIPT()
Message
De
17/04/2004 04:52:34
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
 
 
À
17/04/2004 04:36:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00894607
Message ID:
00895798
Vues:
21
I've already stated that it was my intention to pass an "object" (to simulate an array).

The object ("o1") is being passed into the script as "to1" via the lparamter statement.

"to1.a[1] = 'fee'" is a statement in the script.

(I could have placed the parameter statement and assign in a string and passed the string to EXECSCRIPT() ... same difference).

These is NO "external reference" in the script (which would have been "o1").

o1 can be public, local, or private ... no difference. Objects are ALWAYS passed by reference.

>
>It is possible to pass to EXECSCRIPT by reference ... apparently not with primitives, but by using objects (which I can live with); eg.
>
>o1 = createobject("myarray")
>
>= execscript( "lparameter to1" + chr(10) + "to1.a[1] = 'fee'", o1)
>
>? o1.a[1]
>
>define class myarray as custom
> dimension a[1]
>enddefine
>

>
>Sorry Gerry.
>
>This is equivalent to a Private variable schema,
>because you must put into the script the external name:
>
>PRIVATE a
>DIMENSION a[1]
>EXECSCRIPT(" here you must put a[1] ...")
>

>like
>
> execscript( "lparameter to1" + chr(10) + "to1.a[1] = 'fee'", o1)
>

>
>The essence of a "pass by reference" is the renaming operation into the code.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform