Procedure AddASinglePath Local loFolder As Object Local loFSO As Object Local lcInputValue As String Local lcNewDir As String Local lcNewPath As String Local lcOldDir As String Local lcPrompt As String m.lcPrompt = 'Pick your directory' m.lcOldDir = Sys(5)+Curdir() m.lcNewDir = '' *-- GETDIR([cDirectory [, cText] [, cCaption [, nFlags [, lRootOnly]]]]) m.lcInputValue = Getdir(m.lcNewDir, m.lcPrompt, HLSTART_APPLICATION_HEADER, 64) If Empty(m.lcInputValue) Wait Window Chr(13) + ' Nothing selected ! ' + Chr(13) Else *-- Get the original capitalization of the path name elements. m.loFSO = Createobject('Scripting.FileSystemObject') m.loFolder = m.loFSO.GetFolder( m.lcInputValue ) m.lcInputValue = Addbs(m.loFolder.Path) Store .Null. To m.loFolder, m.loFSO Endif Empty(m.lcInputValue) ..... Endproc && AddASinglePathwhich resulted in the message:
*********************** Function AddASinglePath *********************** Add ; Local m.loFolder, m.loFSOAnd here is the example2:
Function AddPath Lparameters tcExisting As String, tcAdditional As String Local lcElement As String Local lnI As Integer Local lnLinesInArray As Integer Local lcNewPath As String Local Array laPathArray[1] If Type( "m.tcAdditional") <> "C" Or Empty( m.tcAdditional ) Return m.tcExisting Endif Empty( m.tcAdditional ) *-- Add new elements, avoid double entries. If Empty( m.tcExisting ) m.lcNewPath = m.tcAdditional Else m.lcNewPath = m.tcExisting + ";" + m.tcAdditional Endif Empty( m.lcNewPath ) m.lnLinesInArray = Alines(laPathArray,Strtran(Strtran(Strtran(m.lcNewPath,",",";"),";;",";"),";",Chr(13)),4) m.lcNewPath = ";" For m.lnI = 1 To m.lnLinesInArray m.lcElement = Strtran(laPathArray(m.lnI), '"', '') If At( ';' + Addbs(Lower(m.lcElement)) + ';', Lower( m.lcNewPath )) = 0 m.lcNewPath = m.lcNewPath + Addbs( m.lcElement ) + ';' Endif At( Addbs( Lower( Alltrim(laP ... Next m.lnI ... Endfunc && AddPathwhich which resulted in the message:
**************** Function AddPath **************** Add ; Local m Remove Local ; lnI, ;>>Hi All,