Cicode Programming Reference > Cicode Function Categories > Form Functions > FormInput

FormInput

Adds a prompt and edit field to the current form. You should call this function only after the FormNew() function and before the FormRead() function. When FormRead() is called, the form will display with the prompt and edit box. The operator's input is passed back as a string (Text).

Syntax

FormInput(Col,Row,Prompt,Text,Width [, maxTextLength] )

Col:

The number of the column in which the prompt will be placed. Enter a number from 0 (column 1) to the form width - 1. For example, to place the prompt in column 8, enter 7.

Row:

The number of the row in which the prompt will be placed. Enter a number from 0 (row 1) to the form height - 1. For example, to place the prompt in row 6, enter 5.

Prompt:

The prompt string.

Text: - Output Parameter

Variable containing the output text string containing the operator's input.

Note: Only Cicode variables can be used in output parameters, variable or local tags cannot be used and will result in a compiler error if attempted.

Width:

The width of the edit field.

maxTextLength: 

This optional parameter specifies the maximum length of input text. The default value is 0 meaning the string can have the maximum length allowed in the system (Cicode allows strings of 255 characters).

Return Value

The field handle if it is added successfully, otherwise -1 is returned.

Related Functions

FormNew, FormRead

Example

FormInput(1,2,"Recipe",Recipe,20);

See Also

Form Functions

Published June 2018