Sauter la navigation

Topic

Variable in signal path

Page d'accueil ' Communauté ' FPScript ' Variable dans le chemin du signal

  • Ce sujet contient 1 réponse, 2 participants et a été mis à jour pour la dernière fois par Ber…ntz, le il y a 8 années et 9 mois.
Voir les messages de 2 - 1 à 2 (sur un total de 2)
  • Auteur
    Messages
  • #33632
    Her…234
    Participant

    Hi,

    I would like to use a variable instead of the path name when calling a function.

    ie :

    Result = MyFunction(‘FolderASignal1’)

    works fine

    but

    Dim Fld = “FolderA”

    Result = MyFunction(Fld :: Signal1)

    doesn’t work –> syntax problem

    Thanks for Help

    #33633
    Ber…ntz
    Maître des clés

    You can use the indirection operator $string-expression$ to access an FlexPro object from its (path) name given as a string:

    Dim Fld = "FolderA\"
    $Fld : "Signal1"$

    accesses the object ‘Signal1’ in ‘FolderA’ relative to the path of the formula containing the expression. Note the double backslash, it is necessary because the acts as escape character.

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