AGETCLASS( ) Function

Example   See Also

Displays class libraries in the Open dialog box and creates an array containing the name of the class library and class chosen.

Syntax

AGETCLASS(ArrayName [, cLibraryName [, cClassName [, cTitleText
  [, cFileNameCaption [, cButtonCaption]]]]])

Returns

Logical

Arguments

ArrayName

Specifies the name of the array in which the names of the class library and class are placed. If the array you specify doesn't exist, Visual FoxPro automatically creates the array. If the array exists and isn't large enough to contain the names of the class library and class, Visual FoxPro automatically increases the size of the array. If the array is larger than necessary, Visual FoxPro truncates the array. If the array exists and AGETCLASS( ) returns false (.F.) because the Class Library dialog box was closed by pressing ESC, choosing Cancel, or clicking the Close button, the array remains unchanged. If the array doesn't exist and AGETCLASS( ) returns false (.F.), the array isn't created.

The following table lists the contents of each element of the array created when you chose a class.

Element Contents
1 File name of the class library chosen.
2 Name of the class chosen.

cLibraryName

Specifies the name of the class library initially selected when the Open dialog is displayed. The class library name you specify is displayed in the File name text box. An error is generated if the class library you specify doesn't exist or cLibraryName is the empty string or the null value.

cClassName

Specifies the name of the class initially selected in the Class name list when the Open dialog is displayed. If the class you specify doesn't exist, the first class in the Class name list is selected. An error is generated if you omit cLibraryName or cClassName is the null value.

cTitleText

Specifies the text displayed in the title bar of the Open dialog. By default, "Open" is the text displayed.

cFileNameCaption

Specifies the text displayed next to the File name text box. By default, "File name:" is the text displayed.

cButtonCaption

Specifies the caption for the OK button.

Remarks

If you chose a class, AGETCLASS( ) returns true (.T.) and creates a one-dimensional array containing two elements. The first element contains the file name of the class library chosen; the second element contains the name of the class chosen.

False (.F.) is returned if you exit the Class Library dialog box by pressing ESC, choosing Cancel, or clicking the Close button.