Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

DirSelect – PB Docs 2021 – PowerBuilder Library

DirSelect – PB Docs 2021

DirSelect

PowerScript function

Description

When a ListBox has been populated with the DirList function,
DirSelect retrieves the current selection and stores it in a string
variable.

Applies to

ListBox, DropDownListBox, PictureListBox, and DropDownPictureListBox
controls

Syntax

Argument

Description

listboxname

The name of the ListBox control from which you want to
retrieve the current selection. The ListBox must have been
populated using DirList, and the selection must be a drive
letter, a file, or the name of a directory.

selection

A string variable in which the selected path name will be
put.

Return value

Boolean.

Returns true if the current selection is a drive letter or a
directory name (which can contain files and other directories) and false
if it is a file (indicating the user’s final choice). If any argument’s
value is null, DirSelect returns null.

Usage

Use DirSelect in the SelectionChanged event to find out what the
user chose. When the user’s selection is a drive or directory, use the
selection as a new directory specification for DirList.

Examples

The following script for the SelectionChanged event for the ListBox
lb_FileList calls DirSelect to test whether the user’s selection is a
file. If not, the script joins the directory name with the file pattern,
and calls DirList to populate the ListBox and display the current drive
and directory in the StaticText st_FilePath. If the current selection is a
file, other code processes the file name:

See also

DirList

GetFolder


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x