SeeView Manual
SeeView Language Elements
HP NonStop SeeView Manual—526355-004
5-33
Direct Field Updates
{--------------
{ Display a menu of legal values for the selected field.
{ Using the field <label> to the left of cursor, search cache
{ for this <label> and display menu of values for the field.
{ For example: If Return is pressed in First name field the
{ intrinsic #menutext = First [ ] Last [ ].
{ We search cache to find the <First> values for this field.
{ If "<First>" is found in cache, the <First> values are displayed
{ in a menu, and the original panel is protected (using DISPLAY
{ VIDEOTEMP option). Note that this presents the user with what
{ appears to be a Modal screen, because they can't access the
{ parent dialogue box. However, the script is in fact modeless
{ because it doesn't require an ACCEPT FKEYWAIT.
{
{ Some human factors people believe that these modal screens
{ are easier for less experienced users to use. More experienced
{ users may find such modes confusing and overly restrictive
{---------------------------------------------------------------
VAR cursorIndex { Index of cursor in menu
,#fieldName { <name> of field pointed to by cursor
, fieldline:=#fkeyline{ Screen Line location of selected fld
, fieldcol { Screen Col location of selected fld
, nextline:=#fkeyline { Screen Line of next field
, nextcol { Screen Column of next field
,#s:=#menutext { scratch
, i
;
CursorIndex := #fkeycol-#menucol; { Position in menu
scan #s[ CursorIndex ] until "[" -> nextcol; { Find next fld on
if not nextcol then begin { screen. This is
nextline:=nextline+1; { the field after
nextcol:=#menucol; { the cursor
end;
scan back #s[ CursorIndex ] until "["-> i; { Find starting
if not i then return; { location of field
fieldcol := #menucol+i+1; { containing cursor
scan back #s[i-1] while " " ->i; { find end of label
if not i then return;
scan back #s[i] until " " ->i; { find label start
if not i then return;
#fieldname:="<" & #TAKE #s[i:132] & ">"; { build <label> and
search #menutaskid cache #fieldname -> i; { search for <label>
if not i then return; { If not found rtn
below; { Show options menu
window #menutaskid
menu "call InsertText(" &#menuline& "," &#menucol& ","
&(fieldline)& "," &(fieldcol)& ","
&(nextline)& "," &(nextcol)& ")"
cache index i+1 until "*" size 20
Head #fieldname & " Esc-F16" keys F16;
msg(r) "Select " & #fieldname;
line #menuline,#menucol; { Protect all fields
DISPLAY VIDEOTEMP( PROTECT ); { in parent window.
Example 5-15. Example Program Showing Direct Field Update
Techniques (page 2 of 3)