LibraryDirectory PowerScript function
Description
Obtains a list of the objects in a PowerBuilder library. The
information provided is the object name, the date and time it was
last modified, and any comments for the object. You can get a list
of all objects or just objects of a specified type.
Syntax
|
1 |
<span>LibraryDirectory</span> ( <span>libraryname</span>, <span>objecttype</span> <span></span>) |
|
Argument |
Description |
|---|---|
|
libraryname |
A string whose value is the name of the |
|
objecttype |
A value of the LibDirType enumerated
|
Return Values
String. LibraryDirectory returns
a tab-separated list with one object per line. The format of the
list is:
|
1 |
name ~t date/time modified ~t comments ~n |
Returns the empty string (“”) if an error occurs. If any argument’s
value is null, LibraryDirectory returns null.
Usage
If you call LibraryDirectory with a PBD
file as the first argument, no comments are displayed because they
are not included in PBD files.
You can display the result of LibraryDirectory in
a DataWindow control by passing the returned string to the ImportString function
for that DataWindow. The DataWindow should contain three string
columns. The columns must be wide enough to fit the data in the
input string. If not, PowerBuilder reports validation errors.
To return the object’s type, use LibraryDirectoryEx.
For an example of parsing tab-delimited data,
see the Pos function.
Examples
This code imports the string returned by LibraryDirectory
to the DataWindow dw_list and then
redraws the dw_list. The DataWindow
was defined with an external source and three string columns:
|
1 |
String ls_entries |
|
1 |
|
1 |
ls_entries = <span>LibraryDirectory</span>( & |
|
1 |
"c:pbdwTemp.pbl", DirUserObject!) |
|
1 |
dw_list.SetRedraw(FALSE) |
|
1 |
dw_list.Reset( ) |
|
1 |
dw_list.ImportString(ls_Entries) |
|
1 |
dw_list.SetRedraw(TRUE) |