Log In    |    Knowledge Base    |    4D Home
Tech Tip: Getting the path to the 4D Client folder
PRODUCT: 4D Client | VERSION: 6.8 | PLATFORM: Mac & Win
Published On: July 19, 2002

Under 4D v6.8.x, getting the path to the 4D Client folder can be a bit tricky. Since under v6.8.x, the actual 4D Client application is inside the package, the command "Application File" under Mac OS 9 as well as Mac OS X returns a long pathname to the 4D Client inside the package. To get the path to the folder containing the 4D Client (not the one inside the package), all you need to do is truncate and customize the string returned by "Application File".

Let's take at a sample method which does this:

`Method "Get_Path"



ARRAY INTEGER(position_of_slash;0)



If ($vlPlatform=3)




End if

For ($i;1;Length($file_Path))


 If (($slash="\") | ($slash=":"))

    $size_of_array:=Size of array(position_of_slash)

   INSERT ELEMENT(position_of_slash;$size_of_array+1)


 End if

End for

If ($vlPlatform<3)

 $size_of_array:=Size of array(position_of_slash)




 $size_of_array:=Size of array(position_of_slash)



End if

` ==================

All that is needed is to pass to the method "Get_Path" the Application File Path and it returns the path to the 4D Client folder.

$path:=GetPath (Application file)