The Application Builder generates sample code according to how you set the default options on the main window and on the Sample Code options windows. You can specify the target client tool for sample code generation on the main window. Additionally, you can bring up task windows to set "basic" and "advanced" sample code options.
To specify the target client development environment for sample code:
Figure 3-9 Specifying the Client Tool for Sample Code Generation
The client tool field updates to show the new target development environment, and the Sample Code panel (lower left in figure) updates to show sample code for the newly specified client tool.
Figure 3-10 Sample Code Generation Example
To set basic sample code defaults:
This brings up the default options window for sample code. These settings control how sample code is generated. You can change these at any time and immediately see the new sample code for an object.
The table below explains the options available on the basic Sample Code options window. Following the table is an example of the sample code that would be generated based on the settings shown in the figure. (Refer to Listing 3-1.)
Figure 3-11 Sample Code Options (Basic)
The values in the Sample Code options window shown in Figure 3-11 cause the following code to be generated when a module is selected.
Listing 3-1
Generated Sample Code Based on Settings in Figure 3-11
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
Note:
You must click OK to activate your latest changes to this window. If you go directly into the Advanced Sample Code window without first saving your basic changes, the basic options will not be current.
See also help on the Sample Code Options (Basic).
To set advanced sample code defaults:
This brings up the default options window for sample code. An example of this window is shown in Figure 3-11.
This brings up the Advanced Sample Code window.
The following table explains the options available on the Advanced Sample Code options window.
Figure 3-12 Sample Code Options (Advanced)
See also help on the Sample Code Options (Advanced).
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. For more information on viewing sample code, refer to the section "Sample Code" under Working with Objects on the Local Workstation.