Futurebasic/Language/Reference/folder
FOLDER Function
[edit | edit source]FOLDER
[edit | edit source]Function
[edit | edit source]✔ Appearance ✔ Standard ✔ Console
Syntax
[edit | edit source] folderRefNum% = FOLDER(path$, refNum%)
parentFolderVRef% = FOLDER(":",refNum%)
Revised
[edit | edit source]June 14, 2000 (Release 3)
Description
[edit | edit source]Depending on the parameters used, this function does several things with folders (directories). It can:
- Return a reference number for the current default directory.
- Return a reference number for a directory that you specify.
- Change the current default directory.
- Create a new folder.
- Return the parent volume
When FOLDER
returns a reference number, it will either be a volume reference number (if the directory is a root directory), or a working directory reference number (if the directory is not a root directory). You can use this reference number to identify the directory when you use other FB statements such as OPEN
.
This table summarizes the effects of the various parameter combinations. Note that when you use a nonzero number in refNum%
, you can specify either a working directory reference number, a volume reference number, or a drive ID number. When you specify a volume reference number or a drive ID number, it represents the root directory on the specified volume.
|
In |
Out |
|
Function |
|
|
|
|
"" (blank) |
zero |
|
Get the reference number of the parent folder |
":" (colon)
|
any nonzero number
|
Reference number of the parent folder. If no parent folder, it will return refNum% |
|
partial path |
zero |
|
|
full path |
zero |
|
|
blank |
non-zero reference number |
|
|
partial path |
non-zero reference number |
|
|
full path |
any non-zero number |
|
Note:
The reference number returned in folderRefNum%
is a temporary number, which is only valid until your program quits. You cannot use this same number to refer to this folder at a later date. If you need to keep track of a file's location over time, create an alias record for the file.
See Also
[edit | edit source]SYSTEM function; CLOSE FOLDER; FILES$<index>