DADiSP Worksheet Functions > Function Categories > Query Functions > OBJECTLIST

 

OBJECTLIST

Purpose:

Returns a string of the available Labbooks, Worksheets, Datasets,  Series or other objects.

Syntax:

OBJECTLIST(type, menusel, sorted, options, "name")

type

-

Optional. An integer specifying the object type:

0:

No object (default)

1:

Labbooks

2:

Worksheets

3:

Datasets

4:

Series

5:

Units

6:

Files

7:

Debugger breakpoints

8:

Sub-folders

9:

Loaded SPL functions

10:

Loaded macros

11:

Built-in functions

menusel

-

Optional. An integer specifying whether the objects in the list can be selected in a custom menu:

0:

No (default)

1:

Yes, adds menu selection field.

sorted

-

Optional. An integer specifying whether to sort the objects alphabetically:

0:

No, unsorted (default)

1:

Yes, sort list alphabetically.

options

-

Optional. An integer specifying an option depending on the type of list.

"name"

-

Optional. A string representing the name of the Dataset from which to generate a list of series. Only applicable when type is 4.

Example:

picklist("Open", "Dataset:"," " , 1, objectlist(3,0,1))

 

returns a dialog box with a sorted list of all available Datasets in the current Labbook. When the user selects one and clicks OK, the name of the Dataset is returned by the PICKLIST function.

Example:

menulist(objectlist(2,1,1))

 

returns a menu of available Worksheets. The objects can be selected from the menu, and are listed in alphabetical order.

Example:

menulist("Windows Dir", objectlist(6, 1, 1, "windows"))

 

Returns a menu of the files located in the windows directory sorted in alphabetical order.

Example:

dirlist = objectlist(8, 0, 1, gethome+"spl");

dir3 = strget(3, dirlist, strescape(" "));

 

Returns the third sub-directory in the SPL folder.

Example:

viewtext(objectlist(9, 0, 1))

 

Displays a sorted list of the currently loaded SPL functions.

Example:

viewtext(objectlist(10, 0, 1))

 

Displays a sorted list of the currently loaded macros.

Example:

viewtext(objectlist(11, 0, 1))

 

Displays a sorted list of the built-in functions.

Remarks:

Each string in the list is delimited by a CR-LF. See STRGET to obtain a specific string within the list.

 

If type is 8, sub-directories, an option value of 1 returns all sub-directories within the directory tree, otherwise only sub-directories at the top level are returned.

 

If type is 9 or 10, an option value of 1 includes hidden SPL or macros (functions or macros that begin with a leading underscore).

See Also:

MENULIST

PICKLIST

STRGET

STRLIST

VIEWTEXT