GETPATH() |
DEVELOPER |
|
|
Purpose |
.GetPath() provides the ability to retrieve a variety of paths from the client machine. These include: GRAPHICS, GRAPHICS_CACHE, GRAPHICS_URL, WINDOWS, HOME, TEMP. In addition, it can return the paths of any user-defined logical databases that are added to the end of proivconst.ini file. This method is only available for the Client object. |
Object Type |
Client |
Syntax |
variable = Client.GetPath(filename,directory) |
Operation |
variable is a numeric scratch variable for the return code value. |
Remarks |
This command should only be used in the Entry Logic of your function. This method can be used to retrieve the following directories. |
Example |
The following logic statement retrieves the Client directory path. This is the directory in which the background graphic is located. #GRAPHIC = CLIENT.GetPath("%GRAPHICS%",$GRAPHICS_DIR) Initially both graphic directories are retrieved from the client and stored in $GRAPHICS_DIR. The GRAPHICS return value returns a string containing the primary and secondary image search paths defined in the Session options or PIV file. The folders are separated with a semicolon if there are multiple entries. The return codes are as follows: 0 the execution was a success. 674 the pathname was not defined in the Application Definitions file. 675 the defined pathname does not exist on the system. An additional feature is the ability to find the actual location of a graphics file where there are multiple paths defined in the PIV for images: #RC = CLIENT.GETPATH("%GRAPHICS%VIPTree.gif",$PATH) In this example, $CLIENTPATH is populated with the location of the VIPTree.gif image. If it succeeds, #RC is 0 and $PATH contains the full pathname of the image, e.g. “C:\Program Files (x86)\Zellis\PROIV Version 11\Client\Bitmaps\VIPTree.gif". If it fails, #RC is not 0, and $PATH contains the search string, i.e. ‘%GRAPHICS%VIPTree.gif’. It can also be used to check if files are present in the client (%CLIENT%) folder too. For example: #RC = Client.GetPath("%CLIENT%Painter.exe",$PATH) returns the path of the Forms Designer executable if it is installed. The other paths do not support this functionality, it only applies to GRAPHICS and CLIENT. |
Topic ID: 510020