Sample Code Options (Advanced)

You get this window when you choose Tools->Options from the menu bar, click the Sample Code tab, and then click the Advanced button on the initial Sample Code window. This window is where you set "advanced" options that determine how the Active Expert Application Builder generates sample code. Advanced options let you specify details like binding style and prefixes of parameters.

Fields

The following table explains the fields on this window.

Table 7-5 Sample Code Options (Advanced)

Topic Section Field Description

Binding Type

Late or Early

Determines whether the sample code generated when declaring OLE automation server objects is written for early or late binding.

With Late binding, the Account interface would be declared in Visual Basic as:

Dim Account As Object

With Early binding, the declaration is:

Dim Account As DIBank_Account

Parameter Name Prefix

Byte, Boolean, Integer, Long, Single, Double, String, UDT

Controls the names of variables that correspond to operation parameters.

Note that the parameter types shown in the figure are for Visual Basic. These differ slightly in PowerBuilder and Visual C++.

GUI Control Names

Generate GUI Control Names (checkbox)

Determines whether GUI controls or variables are used in the sample code. Unchecking this check box disables text box and list box prefix and suffix values.

Text Box and List Box prefix and suffix fields

Prefix and suffix values are used to decorate the control name; "Input" corresponds to those controls that populate variables used as parameters, and "Output" corresponds to controls populated by service output.

Note: You cannot change the suffixes for a text box.

The following code shows the Inquiry service being called with the input parameter ACCOUNT_ID, a long, coming from a text box. Subsequently, the output of the service is stored in a text box:

lACCOUNT_ID = txtACCOUNT_ID.Text
BANKAPPTELLEROCX1.INQUIRY lACCOUNT_ID, sSBALANCE
txtSBALANCE.Text = sSBALANCE

Buttons

When you have set these options as needed, click OK to save your changes and close the window. (Or click Cancel to close the window without saving your changes.)

See Also

Working with Sample Code, Setting Advanced Sample Code Options

Viewing Sample Code

You can view sample code on an object in the bottom panel of the Workstation Objects window in three different modes; Declarations, Usage, and Cleanup. To change the sample code mode click on one of these three tabs.