Information générale
Catégorie:
Codage, syntaxe et commandes
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement