SeeView Manual

SeeView Language Elements
HP NonStop SeeView Manual526355-004
5-34
Direct Field Updates
When the program in Example 5-15 is invoked:
?MENU declares the definition of the Person dialog box. The Person cache
contains both the screen definition and the values for each field in the screen.
?SECT Main displays the Person dialog box as shown in Figure 5-13, and
associates the production CALL OfferList with the Person dialog box.
When Return is pressed with the cursor in the First name field, as shown in
Figure 5-13, ?PROC Offerlist is called. The procedure uses the text to the left of the
cursor to build a label that represents the name of the field. This label is stored in the
local variable #fieldName. The label is then used to search the cache associated with
the Person dialog box. If the label is found, a menu of the values associated with the
label appears, as shown in Figure 5-14 on page 5-35.
?proc InsertText
{---------------
{ Insert text from calling menu #menutext in parent window field.
{ The parent window and insertion field location are passed.
{----------------------------------------------------------------
PARM ParentLine, ParentCol, { Location of parent window.
FieldLine, FieldCol, { Location of insertion field
NextLine, NextCol; { Location of the next field
VAR #s,i,j; { scratch variables
if #fkey<>16 then begin { If not escape selection menu
#s:= #menutext; { Get text to insert into field
scan #s while " " ->i; { Strip off leading blanks
scan back #s while " " -> j;{ Strip off trailing blanks
LINE FieldLine, FieldCol; { Insert selected text in field
ERASELINE; { First clear old text in field
[ #s[i:j] ]; { Output selected text to field
end;
CLEARW #menuline,#menucol,1; { Delete option menu on screen
LINE ParentLine, ParentCol; { Restore window field defaults
DISPLAY VIDEOTEMP(); { <------<New Feature>---------
if #fkey=16 then { If escape
CURSOR FieldLine, FieldCol { put cursor back in same field
else { Else was value inserted,
CURSOR NextLine, NextCol; { move cursor to next field.
{ end of script 1/5/93/mm
Figure 5-13. SeeView Output From Program in Example 5-15
Example 5-15. Example Program Showing Direct Field Update
Techniques (page 3 of 3)