FlexPro
HistoryBase
Ingénierie
Formation
Téléchargements
Assistance FlexPro
Connaissance
Communauté
À propos de nous
Références
Emplois
Contact général
Liste des revendeurs
Assistance FlexPro
FR
DE
EN
Porte-plaquette
Produits et solutions
Support et téléchargements
Entreprise
Magazine
Contact
Langue
MyWeisang

Paramètres du compte.

Topic

Read access to an argument’s properties

Page d'accueil ' Communauté ' FPScript ' Lire l'accès aux propriétés d'un argument

  • Ce sujet contient 2 réponses, 2 participants et a été mis à jour pour la dernière fois par Anonyme, le il y a 10 années et 1 mois.
Voir les messages de 3 - 1 à 3 (sur un total de 3)
  • Auteur
    Messages
  • #33595
    Anonyme
    Inactif

    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.

    #33597
    Anonyme
    Inactif

    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.

    #33596
    Bernhard Kantz
    Participant

    The 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.

Voir les messages de 3 - 1 à 3 (sur un total de 3)
  • Vous devez être connecté pour répondre à ce sujet.