Tech Tip: Quickest way of finding the folder separator (or path delimter) in 4D v12
PRODUCT: 4D | VERSION: 12 | PLATFORM: Mac & Win
Published On: October 5, 2010
In previous versions of 4D, there were multiple ways of obtaining a folder separator (also known as a path delimiter); including (but not limited to) the following:
- Approach #1
C_TEXT($folderDelimiter;$folderPath)
$folderPath:=Get 4D Folder(Database Folder)
$folderDelimiter:=$folderPath[[Length($folderPath)]] - Approach #2
C_TEXT($delim)
$delim:=(Get 4D folder(Database Folder )[[Length(Get 4D folder(Database Folder ))]]) - Approach #3
C_LONGINT($vlPlatform)
C_TEXT($delim)
PLATFORM PROPERTIES($vlPlatform)
If ($vlPlatform#Windows)
$delim:=":"
Else
$delim:="\\"
End if
As of 4D v12 these are no longer the fastest or easiest ways to find the folder separator. You will no longer need to store an Interprocess variable as part of your On startup code to use as the separator throughout your database. In 4D v12 there is a constant that can be used for this instead; simply use Folder Separator.
The Folder Separator constant will equal the path delimiter specific for the current platform.
- Folder Separator = ":" on Mac OS X
- Folder Separator = "\" on Windows
This information is visible from within the 4D Explorer as depicted in the following screen shots:
Windows:
Mac OS X:
See Also: