KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: How to retrieve the path of a created document
PRODUCT: 4D | VERSION: 2004.4 | PLATFORM: Mac & Win
Published On: November 29, 2006

When you create a document using the Create Document command, the system variable Document contains the pathname of the document created (assuming that the document was created successfully).

Before checking the system variable Document, you should check the system variable OK to see if the document was successfully created. The OK variable is set to 1 when document is correctly created and opened. The code below shows how to retrieve the pathname of the document created:


C_TIME(vhDoc)
C_TEXT(mDocPathname)
vhDoc:=Create document("") ` Create new document using the save dialog.
If (OK=1)
mDocPathname:=Document ` Get pathname of document
CLOSE DOCUMENT(vhDoc) ` Close the document
End if