| 4D v15 R3System Documents | ||||||||||||||
| 
 | 
    4D v15 R3
 System Documents 
         | |||||||||||||
| Escape sequence | Character replaced | 
| \n | LF (New line) | 
| \t | HT (Horizontal tab) | 
| \r | CR (Carriage return) | 
| \\ | \ (Backslash) | 
| \" | " (Quotes) | 
Most commands for managing 4D documents and folders accept either relative or absolute pathnames:
To determine whether a pathname passed to a command must be interpreted as absolute or relative, 4D applies a specific algorithm on each platform.
If the parameter contains only two characters and if the second one is a ':',
    or if the text contains ':' and '\' as the second and third character,
    or if the text starts with "\\",
then the pathname is absolute.        
In all other cases, the pathname is relative.
Examples with the CREATE FOLDER command:
 CREATE FOLDER("lundi") // relative path
 CREATE FOLDER("\Monday") // relative path
 CREATE FOLDER("\Monday\Tuesday") // relative path
 CREATE FOLDER("c:") // absolute path
 CREATE FOLDER("d:\Monday") // absolute path
 CREATE FOLDER("\\srv-Internal\temp") // absolute path If the text starts with a folder separator ':',
    or if does not contain any, 
then the path is relative.
In all other cases, it is absolute.
Examples with the CREATE FOLDER command:
 CREATE FOLDER("Monday") // relative path
 CREATE FOLDER("macintosh hd:") // absolute path
 CREATE FOLDER("Monday:Tuesday") // absolute path (a volume must be called Monday)
 CREATE FOLDER(":Monday:Tuesday") // relative path• Detecting on which platform you're running
Although 4D provides commands, such as MAP FILE TYPES, for eliminating coding variations due to platform specificities, once you start to work at a lower level when handling documents on disk (such as programmatically obtaining pathnames), you need to know if you are running on a Macintosh or a Windows platform.
The On Windows project method listed here tells whether your database is running on Windows:
  //On Windows Project Method
  //On Windows -> Boolean
  //On Windows -> True if on Windows
 
 C_BOOLEAN($0)
 C_LONGINT($vlPlatform;$vlSystem;$vlMachine)
 
 PLATFORM PROPERTIES($vlPlatform;$vlSystem;$vlMachine)
 $0:=($vlPlatform=Windows)• Extracting the file name from a long name
Once you have obtained the long name (pathname + file name) of a document, you may need to extract the file name of the document from that long name in order, for example, to display it in the title of a window. The Long name to file name project method does this on both Windows and Macintosh.
  //Long name to file name Project Method
  //Long name to file name ( String ) -> String
  //Long name to file name ( Long file name ) -> File name
 
 C_TEXT($1;$0)
 C_LONGINT($viLen;$viPos;$viChar;$viDirSymbol)
 
 $viDirSymbol:=Character code(Folder separator)
 $viLen:=Length($1)
 $viPos:=0
 For($viChar;$viLen;1;-1)
    If(Character code($1≤$viChar≥)=$viDirSymbol)
       $viPos:=$viChar
       $viChar:=0
    End if
 End for
 If($viPos>0)
    $0:=Substring($1;$viPos+1)
 Else
    $0:=$1
 End if
 If(<>vbDebugOn) //Set this variable to True or False in the On Startup database method
    If($0="")
       TRACE
    End if
 End if• Extracting the pathname from a long name
Once you have obtained the long name (pathname + file name) of a document, you may need to extract the pathname of the directory where the document is located from that long name; for instance, you may want to save additional documents at the same location. The Long name to path name project method does this on both Windows and Macintosh.
  //Long name to path name Project Name
  //Long name to path name ( String ) -> String
  //Long name to path name ( Long file name ) -> Path name
 
 C_TEXT($1;$0)
 C_LONGINT($viLen;$viPos;$viChar;$viDirSymbol)
 
 $viDirSymbol:=Character code(Folder separator)
 $viLen:=Length($1)
 $viPos:=0
 For($viChar;$viLen;1;-1)
    If(Character code($1≤$viChar≥)=$viDirSymbol)
       $viPos:=$viChar
       $viChar:=0
    End if
 End for
 If($viPos>0)
    $0:=Substring($1;1;$viPos)
 Else
    $0:=$1
 End if
 If(<>vbDebugOn) //Set this variable to True or False in the On Startup database method
    If($0="")
       TRACE
    End if
 End if
									Append document
									
									CLOSE DOCUMENT
									
									COPY DOCUMENT
									
									Create document
									
									CREATE FOLDER
									
									DELETE DOCUMENT
									
									Document creator
									
									DOCUMENT LIST
									
									Document type
									
									FOLDER LIST
									
									Get document position
									
									GET DOCUMENT PROPERTIES
									
									Get document size
									
									MAP FILE TYPES
									
									MOVE DOCUMENT
									
									Open document
									
									Select document
									
									SET DOCUMENT CREATOR
									
									SET DOCUMENT POSITION
									
									SET DOCUMENT PROPERTIES
									
									SET DOCUMENT SIZE
									
									SET DOCUMENT TYPE
									
									System Documents
									
									Test path name
									
									VOLUME ATTRIBUTES
									
									VOLUME LIST
									
	Product:  4D
	Theme:  System Documents
	
        
        
	
	
	
	
	4D Language Reference ( 4D v15 R3)
	
	4D Language Reference ( 4D v15)
	
	
 Add a comment
Add a comment