ThisForm
A data structure that provides information about the state of the current form at the time of the last event in the current window.
The ThisForm data structure provides information about the state of the current form at the time of the last event in the current window.
The ThisForm structure contains a number of fields that are reset when a window containing a form or display becomes the current window. An application program can use the information in the fields to determine what action, if any, to take.
The fields in the ThisForm structure are
Syntax # 1 – DisplayTag
The tag of the display that had focus at the time of the last event in the current window.
thisform.displaytag
Return Value
Character string identification tag of the current display. Can be reset by an application program.
Description
Identifies, by identification tag, the display that had focus at the time of the last event in the current window.
Syntax # 2 – FieldChanged
A code indicating if the form field that had focus at the time of the last event in the current window was modified by the application user.
thisform.fieldchanged
Return Value
“1” ($True), or “0” ($False). Can be reset by an application program.
Description
Set to “1” ($True) if the value of the field that had focus changed after the application user was placed in control of the interface. Otherwise, set to “0” ($False).
Syntax # 3 – FFFieldNum
The identification number of the form field that had focus at the time of the last event in the current window.
thisform.fffieldnum
Return Value
A number. Can be reset by an application program.
Description
The identification number of the form field that had focus at the time of the last event in the current window.
The combination of ThisForm.FormNum, ThisForm.Subscript, and ThisForm.FFFieldNum can uniquely identify a particular form field in a particular form.
Example
form set (cursor) (ThisForm.formnum,ThisForm.fffieldnum,ThisForm.subscript)
Syntax # 4 – FieldTag
The tag of the form field that has focus at the time of the last event in the current window.
thisform.fieldtag
Return Value
A character string. Can be reset by an application program.
Description
The identification tag of the focus form field at the time of the last event in the current window.
The combination of ThisForm.FormNum, ThisForm.Subscript, and ThisForm.FFFieldNum can uniquely identify a particular form field in a particular form.
Syntax # 5 – FormChanged
A code indicating if any form field in the form or display had been modified by the application user at the time of the last event in the current window.
thisform.formchanged
Return Value
“1” ($True), or “0” ($False). Can be reset by an application program.
Description
Set to “1” ($True) if the value of any field in the current form or display changed after the application user was placed in control of the interface. Otherwise, set to “0” ($False).
Syntax # 6 – FormNum
The form number of the form that had focus at the time of the last event in the current window.
thisform.formnum
Return Value
A number. Can be reset by an application program.
Description
The identification number of the current form at the time of the last event in the current window.
The combination of ThisForm.FormNum, ThisForm.Subscript, and ThisForm.FFFieldNum can uniquely identify a particular field in a particular form.
Example
form set (cursor) (ThisForm.formnum,ThisForm.fffieldnum,ThisForm.subscript)
Syntax # 7 – FormTag
The identification tag of the form that had focus at the time of the last event in the current window.
thisform.formtag
Return Value
A character string. Can be reset by an application program.
Description
The identification tag of the current form at the time of the last event in the current window.
The combination of ThisForm.FormNum, ThisForm.Subscript, and ThisForm.FFFieldNum can uniquely identify a particular field in a particular form.
Syntax # 8 – ReqError, ReqFieldNum, ReqFormNum, ReqSubscript, ReqTag
thisform.reqerror
thisform.reqfieldnum
thisform.reqformnum
thisform.reqsubscript
thisform.reqtag
Return Value
Character string (binary). Can be reset by an application program. (ReqError)
Character string (alpha). Can be reset by an application program. (ReqTag)
Number (INT). Can be reset by an application program. (ReqFieldNum, ReqFormNum, ReqSubscript)
Description
The variables indicate if all required form fields had values at the time of the last event in the current window.
ThisForm.ReqError is set to ‘1’ ($True) if any required form field in the current form or display has not been completed when an event occurs. Otherwise, it is set to ‘0’ ($False).
If ThisForm.ReqError is ‘1’, then the other variables are set to the form number (ThisForm.ReqFormNum), form field number (ThisForm.ReqFieldNum), subscript (ThisForm.ReqSubScript), and tag (ThisForm.ReqTag) of a required form field that has no value.
Example
while
form input
…commands…
if ThisForm.reqerror = $true
form set (focus) (ThisForm.reqformnum,ThisForm.reqfieldnum,ThisForm.reqsubscript)
continue
endif
endwhile
If “required” fields in the current form have not been completed, focus is set to one of those fields on the next input request.
Syntax # 9 – Subscript
The instance of the form where focus was located at the time of the last event in the current window.
thisform.subscript
Value
A number. Can be reset by an application program.
Description
Identifies, by number, the instance of the form where focus was located at the time of the last event in the current window (when several instances of the form appear in a display). If the form appears only once, ThisForm.Subscript is always 1.
For example, if a form is repeated eight times in a display, ThisForm.Subscript might be set to any number from 1 to 8. The particular number indicates in which repetition of the form the focus was located.
The combination of ThisForm.FormNum, ThisForm.Subscript, and ThisForm.FFFieldNum can uniquely identify a particular field in a particular form.
Example
form set (cursor) (ThisForm.formnum,ThisForm.fffieldnum,ThisForm.subscript)
find Products where ProdCode = fProducts.ProdCode[ThisForm.subscript]
Syntax # 10 – ValError, ValFieldNum, ValFormNum, ValSubscript, ValTag
thisform.valerror
thisform.valfieldnum
thisform.valformnum
thisform.valsubscript
thisform.valtag
Value
Character string (binary). Can be reset by an application program. (ValError)
Character string (alpha). Can be reset by an application program. (ValTag)
Number (INT). Can be reset by an application program. (ValFieldNum, ValFormNum, ValSubscript)
Description
The variables indicate if all form fields had valid values at the time of the last event in the current window.
ThisForm.ValEror is set to ‘1’ ($True) if any form field in the current form or display contains an invalid value when an event occurs. Otherwise, it is set to ‘0’ ($False).
If ThisForm.ValError is ‘1’, then the other variables are set to the form number (ThisForm.ValFormNum), form field number (ThisForm.ValFieldNum), subscript (ThisForm.ValSubscript), and tag (ThisForm.ValTag) of a form field that has an invalid value.
Example
while
form input
…commands…
if ThisForm.valerror = $true
form set (cursor) (ThisForm.valformnum,ThisForm.valfieldnum,ThisForm.valsubscript)
continue
endif
endwhile
If fields in the current form failed the validation check, focus is set to one of those fields on the next input request.