Topic
Read access to an argument’s properties
Página de inicio ' Community ' FPScript ' Acceso de lectura a las propiedades de un argumento
- Este tema contiene Respuestas 2, Voces 2, y fue actualizado por última vez el Hace 10 años, 11 meses por Anónimo.
-
AutorPuestos
-
23.03.2015 en 11:59 #33595AnónimoInactivo
Hello,
I write a formula template and need to look at some properties of the arguments.
Here’s the code of the formula “MyFormula” :
[code]Arguments sig
MessageBox “MyFormula – Signal name = ” : sig.Name // second message box[/code]Here’s the code I use to call “MyFormula” :
[code]MessageBox “Signal name = ” : MySignal.Name // first message box
MyFormula ( MySignal)
[/code]FlexPro dispays the first message box, but reports an error “Read access to the object property or the list element ‘Name'”, at the ligne 2 in “MyFormula”.
What’s wrong in my FPScript ?
Is It possible to have read access to the argument’s properties ?Best regards.
23.03.2015 en 11:59 #33597AnónimoInactivoHello,
I write a formula template and need to look at some properties of the arguments.
Here’s the code of the formula “MyFormula” :
[code]Arguments sig
MessageBox “MyFormula – Signal name = ” : sig.Name // second message box[/code]Here’s the code I use to call “MyFormula” :
[code]MessageBox “Signal name = ” : MySignal.Name // first message box
MyFormula ( MySignal)
[/code]FlexPro dispays the first message box, but reports an error “Read access to the object property or the list element ‘Name'”, at the ligne 2 in “MyFormula”.
What’s wrong in my FPScript ?
Is It possible to have read access to the argument’s properties ?Best regards.
24.03.2015 en 08:35 #33596Bernhard KantzKeymasterThe reason for the error is the passing of arguments by value to FPScript function formulas. So the argument sig soesn’t hold the object MySignal, it just gets its value contained in. This will change in FlexPro 10.
If you want to access the object in FlexPro 9, you have to pass the name and access the properties via the indirection operator. E.g. $”MySignal”$.FullName will give you the full path. -
AutorPuestos
- Debes estar registrado para responder a este tema.