Topic
Variable search string for Objects.Names
Page d'accueil ' Communauté ' FPScript ' Chaîne de recherche variable pour Objets.Noms
- Ce sujet contient 2 réponses, 2 participants et a été mis à jour pour la dernière fois par John Gerhardy, le il y a 12 années et 7 mois.
-
AuteurMessages
-
22.10.2012 à 16:13 #33532John GerhardyParticipant
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$”).Namesgive 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$).Namesbut this results in a “Variable not declared” error.
Syntax error or no can do?
Regards,
jgerhardy22.10.2012 à 16:13 #33534John GerhardyParticipantHello,
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$”).Namesgive 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$).Namesbut this results in a “Variable not declared” error.
Syntax error or no can do?
Regards,
jgerhardy26.10.2012 à 13:54 #33533Bernhard KantzParticipantThe 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] -
AuteurMessages
- Vous devez être connecté pour répondre à ce sujet.