Dir Method (COMBOBOX / DATALIST)
PLBCMP GUI Only
The Dir method fills a DATALIST or COMBOBOX object with file names that match a given specification. The method uses the following format:
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
object
Required. A DATALIST or COMBOBOX object that is filled.
return
Optional. A Numeric Variable that returns the zero-based position of the last string in the list.
filespec
Required. A Character String Variable or literal that contains the file specification string.
flags
Required. A decimal number or Numeric Variable that indicates an action from the table below.
Flags Affected: EOS, OVER, ZERO
Note the following:
{filespec} is the file specification string that may contain wildcard characters. {filespec} may include a standard or a UNC path.
{flags} is a numeric variable, literal or keyword as defined in PLBMETH.INC indicating the following actions. These bit values may be added together as needed:
|
Value |
Keyword |
Includes ... |
|
0x0 |
DDL_READWRITE |
Files that can be read or written. |
|
0x1 |
DDL_READONLY |
Files that can be read but not written. |
|
0x2 |
DDL_HIDDEN |
Hidden files. |
|
0x4 |
DDL_SYSTEM |
System files. |
|
0x10 |
DDL_DIRECTORY |
Directories. |
|
0x20 |
DDL_ARCHIVE |
File has been archived. |
|
0x4000 |
DDL_DRIVES |
Include all drives. |
|
0x8000 |
DDL_EXCLUSIVE |
Exclusive flag. If the exclusive flag is set, only files of the specified type are listed. Otherwise, files of the specified type are listed in addition to normal files. |
Upon completion, {return} will contain the zero-based index of the last filename in the list or -1 if the method fails.
If the value returned is zero, the ZERO Condition Flag is set.
If {return} is too small to contain the string index, the OVER Condition Flag is set.
The EOS Condition Flag is always cleared.
The DIR method for the DATALIST object is executed as a direct Windows method for GUI object. For the Application Server environment this method is executed at the PLBCLIENT workstation and reflects that workstation's disk data. For the Application Server environment, the DIR method can not retrieve any disk information from the PLBSERVE server. The FINDDIR instruction can retrieve disk information from either the PLBCLIENT workstation or the PLBSERVE server.
For improved performance in the Application Server environment, do not specify the optional return value unless needed.
Obsolete version of Windows (98/ME) may not support long file names.
This method is implemented by Microsoft and has known issues. In some cases, all files are not returned based on the file attribute and current OS settings. It is Sunbelt's recommendation to use FINDDIR instruction.
This method is not supported when using the PL/B Web Server.
See Also: Method Syntax, DATALIST Methods, COMBOBOX Methods
![]() |