Sample Code Options (Basic)

You get this window when you choose Tools->Options from the menu bar and click the Sample Code tab. This window is where you set options that determine how the Active Expert Application Builder generates sample code. You can set "basic" options such as specifying how the Active Expert generates the sample code displayed for tree objects, location of Environment file and application, and so on. You can also set "advanced" options that let you specify details like binding style and prefixes of parameters.

Note: To specify the Client Tool (read only here), use the drop-down menu in the tool bar on the main window. (See Specifying the Target Client Tool for Sample Code.)

Fields

The following table explains the fields on this window.

Table 7-4 Sample Code Options (Basic)

Topic Section Field Description

Generate Sample Code

Indicates whether you want sample code to be generated. This box must be checked for sample code to be generated. If it is not checked, every other control on this window is disabled. (In the figure, this is on.)

Automatic Paste to Clipboard

Indicates whether you want the code that appears in the sample code window (for a selected object) to be copied into the clipboard automatically. (In the figure, this is on.)

Client Tool

Indicates the client application development tool you are using. Sample code is generated for the specified client development environment (Visual Basic, PowerBuilder, or Visual C++). In the figure, this is set to Visual Basic.

You can specify this option from the tool bar on the main window. (See Specifying the Target Client Tool for Sample Code.)

Session

Envfile and App

Indicates the name of the TUXEDO environment file (Envfile) you want to use and TUXEDO application (App) to which you want to connect.

Authentication

Use as GUI Names

Indicates whether you want to generate the authentication parameters as default GUI controls (for example, txtUserName.Text) if checked, or as text (for example, "frank") if unchecked. (In the figure, this is on, so authentication parameters will be generated as GUI controls.)

The authentication parameters are your entries for Username, Role, Application Password, and User Password.

Username

Authentication parameter for user name. (Required to join a secure TUXEDO application.)

Role

Authentication parameter for role. (Required to join a secure TUXEDO application.)

Application Password

Authentication parameter for application password. (Required to join a secure TUXEDO application.)

User Password

Authentication parameter for user password. (Required to join a secure TUXEDO application.)

Additional Code

Generate exception handling code

Enables or disables the generation of client tool error handling code when an operation is selected in the Workstation Objects window. (In the figure, this is off.)

Generate code for Transaction object

Indicates whether to generate transaction object code. Checking this option on also enables the Timeout Value editable field. (In the figure, this is off.)

Timeout Value

Forces generation of the parameter of the transaction object's Begin method. (In the figure, this is disabled.)

Example

The values in the Sample Code options window shown here cause the following code to be generated when a module is selected:

Set Session = CreateObject ("Tobj.Session")
Call Session.set_env_var ("WSENVFILE", "c:\tuxedo.ini")
Call Session.set_env_var ("WSAPP", "MyApp")
ret = Session.Logon (txtUsername.Text, txtRole.Text,
txtApppwd.Text, txtUpwd.Text, UserData)
If ret = SecAuthFailure Then
MsgBox "Logon Failed"
End
End If

Buttons

When you have set these options as needed, click OK to save your changes and close the window.

Note: You must click OK to activate your latest changes to this window. If you go directly into the Advanced Sample Code Options window (by clicking on Advanced) without first saving your basic changes, the basic options will not be current.

If you have reset the basic options and now want to reset options on the Advanced Sample Code window, you must first verify your new "basic" options by clicking OK and closing the basic window.

(You can also click Cancel to close the window without saving your changes.)

See Also

Working with Sample Code, Setting Basic 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.