KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Executing Structure File command on 4D Client vs. 4D Stand-alone
PRODUCT: 4D | VERSION: | PLATFORM: Mac & Win
Published On: September 19, 2002
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

Versions: 6.7.x and 6.8.x

The Structure File command returns the name of the structure file if it is executed in 4D Client and a full path name to the structure file if it is executed in a stand-alone application. If you want to retrieve only the name of the structure file regardless of what application you are running, you can use the following project method that will return the name of the structure for you.

` Project Method: Get_Structure_Name
` Description: Return the name of the structure file.

C_TEXT($0;$sep;$Structure)
$Structure:=Structure file

If (Application type#4D Client)
 C_LONGINT($Platform;$System;$Machine;$len)
 PLATFORM PROPERTIES($Platform;$System;$Machine)
 If ($Platform=3)
   $sep:="\"
 Else
   $sep:=":"
 End if
 $len:=Length($Structure)
 Repeat

   If ($Structure[[$len]]=$sep)
     $Structure:=Substring($Structure;$len+1;Length($Structure)-$len)
     $len:=0
   Else
     $len:=$len-1
   End if
 Until ($len<=0)
End if

$0:=$Structure