Select folder

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 6.5


Select folder {(message)} String

ParameterTypeDescription
messageStringTitle of the window
Function resultStringAccess path to the selected folder

Description

The Select folder command displays a dialog box that allows you to manually select a folder and then retrieve the complete access path to that folder.

Note: This command does not modify 4D's current folder.

The Select folder command displays a standard dialog box to browse through the workstation's volumes and folders.

The optional parameter message allows you to display a message in the dialog box. In the following examples, the message is "Select a destination folder":

Windows

Mac OS

The user selects a folder and then clicks the OK button (on Windows) or the Select button (on Mac OS). The access path to the folder is then returned by the function.

On Windows, the access path is returned in the following format:

"C:\Folder1\Folder2\SelectedFolder\"

On Mac OS, the access path is returned in the following format:

"Hard Disk:Folder1:Folder2:SelectedFolder:"

Note: On Mac OS, depending on whether or not the name of the folder is selected in the dialog box, the access path that is returned to you may be different.

4D Server: This function allows you to view the volumes connected to the client workstations. It is not possible to call this function from a stored procedure.

If the user validates the dialog box, the OK system variable is set to 1. If the user clicks the Cancel button, the OK system variable is set to 0 and the function returns an empty string.

Note: On Windows, if the user selected some incorrect elements, such as "Workstation", "Trash can", and so on, the OK system variable is set to 0, even if the user validates the dialog box.

Example

The following example allows you to select the folder in which the pictures in the picture library will be stored:

   $PictFolder:=Select folder("Select a folder for your pictures.")
   PICTURE LIBRARY LIST (pictRefs;pictNames)
   For ($n;1;Size of array(pictNames))
      $vRef:=Create document($PictFolder+pictNames{$n};"PICT")
      If (OK=1)
         GET PICTURE FROM LIBRARY(pictRefs{$n};$vStoredPict)
         SAVE PICTURE TO FILE($vRef;$vStoredPict)
         CLOSE DOCUMENT($vRef)
      End if
   End for

See Also

CREATE FOLDER, FOLDER LIST.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next