FlexPro
HistoryBase
Engineering
Training
Downloads
FlexPro-Support
Wissen
Community
Über Uns
Referenzen
Jobs
Allgemeiner Kontakt
Händlerverzeichnis
FlexPro-Support
DE
EN
FR
Placeholder
Produkte und Lösungen
Support und Downloads
Unternehmen
Magazin
Kontakt
Sprache
MyWeisang

Account Einstellungen

Topic

Variable search string for Objects.Names

Startseite ' Community ' FPScript ' Variable search string for Objects.Names

Anzeigen von 3-Stellen - 1 bis 3 (von insgesamt 3)
  • Autor
    Beiträge
  • #33532
    John Gerhardy
    Teilnehmer

    Hello,

    I would like to have the search string for the Objects.Names property. Is it possible to use the indirect operator ($$) to accomplish this?

    Example:
    Dim TransscriptNames = Messdaten.Objects(“^P1.*.fld$”).Names

    give me the names of the folders starting with “P1”, which I would like to be variable, so I tried this:
    Dim SearchString = “^” : “P1” : “.*\.fld$” //”^sig.*.dat$”
    Dim TransscriptNames = Messdaten.Objects($SearchString$).Names

    but this results in a “Variable not declared” error.

    Syntax error or no can do?

    Regards,
    jgerhardy

    #33534
    John Gerhardy
    Teilnehmer

    Hello,

    I would like to have the search string for the Objects.Names property. Is it possible to use the indirect operator ($$) to accomplish this?

    Example:
    Dim TransscriptNames = Messdaten.Objects(“^P1.*.fld$”).Names

    give me the names of the folders starting with “P1”, which I would like to be variable, so I tried this:
    Dim SearchString = “^” : “P1” : “.*\.fld$” //”^sig.*.dat$”
    Dim TransscriptNames = Messdaten.Objects($SearchString$).Names

    but this results in a “Variable not declared” error.

    Syntax error or no can do?

    Regards,
    jgerhardy

    #33533
    Bernhard Kantz
    Teilnehmer

    The Objects.Names property uses a string as select argument. This can be a constant string like “^P1.*.FLD$” or a variable containing such a value.
    If for example someone wants to specify the folder by a varying number, a code fragment like
    [code]
    Dim no = 1
    Dim select = “^P” : String no : “.*.FLD$”
    dim folderNames = Messdaten.Objects(select).Names
    [/code]
    lists all folders under the root folder Messdaten prefixed with ‘P’ and the number.
    If one uses names like “P001”, “P002”, … to distinguish between the different objects, the following expression constructs these strings from a numeric value:
    [code]
    Dim no = 1
    Dim objName = “P” : StringMid(String (no + 1000), 1)
    [/code]

Anzeigen von 3-Stellen - 1 bis 3 (von insgesamt 3)
  • Du musst angemeldet sein, um auf dieses Thema antworten zu können.