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

Paramètres du compte.

Topic

Folder Referencing

Page d'accueil ' Communauté ' Automation et VBA ' Référencement de dossiers

Voir les messages de 3 - 1 à 3 (sur un total de 3)
  • Auteur
    Messages
  • #35171
    Fiona Vidal
    Participant

    Good morning,

    I would like to reference folders in the Folders window in sequence without using specific folder names but the order that they appear in the window – is this possible?

    Many thanks for your help!

    #35173
    Fiona Vidal
    Participant

    Good morning,

    I would like to reference folders in the Folders window in sequence without using specific folder names but the order that they appear in the window – is this possible?

    Many thanks for your help!

    #35172
    Bernhard Kantz
    Participant

    When using the .Objects property of a Folder object with argument fpObjectTypeFolder the sequence of the folder objects in the FPObjects collection should be the same as in the Folder window (not in the Object List window). The following procedure outputs all folders in the root of the active project database.

    [code]
    Public Sub ShowFolders()

    Dim oColl As FpObjects
    Set oColl = ActiveDatabase.RootFolder.Objects(fpObjectTypeFolder)

    Dim sRes As String
    Dim oObj As FpObject
    For Each oObj In oColl
    sRes = sRes & oObj.Name & vbCrLf
    Next

    MsgBox sRes

    End Sub
    [/code]

    Specifying a string pattern instead of [i]fpObjectTypeFolder[/i] can be used to narrow the collection of folders. For example the FPScript string [b]”^Data\d{3}\.FLD$”[/b] will enumerate all folders ([b]\.FLD$[/b]) whose names start with Data ([b]^Data[/b]) followed by three digits ([b]\d{3}[/b]). Note the double backslash because its use as escape character in string literals. More on regular expressions can be found in the Online Help for Objects (property) in the Index.

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