Macros and the IBM CognosScript Language  7.5.0
IBM CognosScript Statements and Functions >

TextBox Statement

Description

Creates a text box in a dialog box.

Syntax

TextBox [NoEcho] x , y , dx , dy , .field

where:

is:

x , y

The upper left corner coordinates of the text box, relative to the upper left corner of the dialog box.

dx , dy

The width and height of the text box area.

.field

The name of the dialog record field to hold the text string.

Comments

A dy value of 12 will usually accommodate text in the system font.

When the user selects the OK button, or any pushbutton other than cancel, the text string entered in the text box will be recorded in .field.

The NoEcho keyword is often used for passwords; it displays all characters entered as asterisks (*).

Use the TextBox statement only between a Begin Dialog and an End Dialog statement.

Example

This example creates a dialog box with a group box, and two buttons.

Sub main
   Begin Dialog UserDialog 194, 76, "CognosScript Dialog
Box"
      GroupBox  9, 8, 97, 57, "File Range"
      OptionGroup .OptionGroup2
         OptionButton  19, 16, 46, 12, "All pages", _
            .OptionButton3
         OptionButton  19, 32, 67, 8, "Range of pages",_
            .OptionButton4
      Text  25, 43, 20, 10, "From:", .Text6
      Text  63, 43, 14, 9, "To:", .Text7
TextBox  79, 43, 13, 12, .TextBox4
      TextBox  47, 43, 12, 11, .TextBox5
      OKButton  135, 6, 54, 14
      CancelButton  135, 26, 54, 14
   End Dialog
   Dim mydialog as UserDialog
   On Error Resume Next
   Dialog mydialog
   If Err=102 then
      MsgBox "Dialog box canceled."
   End If
End Sub

See Also

Begin Dialog...End Dialog Statement

Button Statement

ButtonGroup Statement

CancelButton Statement

Caption Statement

CheckBox Statement

ComboBox Statement

Dialog Function

DropComboBox Statement

GroupBox Statement [IBM CognosScript Extension]

ListBox Statement

OKButton Statement

OptionButton Statement

OptionGroup Statement

Picture Statement

StaticComboBox Statement

Text Statement