KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Getting Server Folder Paths From 4D Client
PRODUCT: 4D | VERSION: 15.2 | PLATFORM: Mac & Win
Published On: September 2, 2016

Here is a quick uility method that can help obtain the folder paths of the 4D Server (paths returned by Get 4D Folder) from the 4D Client:

If (Count parameters=1)
   $0:=Get 4D folder($1)
Else
   $0:=Get 4D folder
End if


The next step to make this work is checking the "Execute On Server" property method:


If the method is saved as UTIL_SRV_Get4DFolder then it could be used like this:
ALERT ( UTIL_SRV_Get4DFolder )


One of the benefits to this setup is that the UTIL_SRV_Get4DFolder method accepts the same constants accepted by Get 4D Folder allowing you to write code like this:
ALERT ( UTIL_SRV_Get4DFolder ( Current resources folder ) )