SeeView Manual

SeeView Statements and Script Symbols
HP NonStop SeeView Manual526355-004
9-40
FLUSH
For example, the WINDOW statement has many options that are specified with
keywords. You can make these options into parameters by declaring a string
variable that contains these options, such as #WindowOptions:=“CACHE LAST
EOFONLY” and then performing:
EXECUTE "WINDOW fup " & #WindowOptions.
4. A fourth use of the EXECUTE statement is to associate procedural rules with
keywords contained in a file or cache. Then when a keyword is encountered, the
rule can be looked up and executed.
For example, the following menu associates rules with keywords. The procedure
Perform then performs the rule associated with each keyword contained in a list of
keywords.
FLUSH
The FLUSH statement forces compiled screen data to be displayed immediately.
Screen output data is normally buffered until the end of compilation or is automatically
flushed if the buffer is full. By causing immediate display of data, the FLUSH statement
provides a means of controlling when buffer output occurs.
?MENU rules
{--------}
ADD= CALL AddRecord ("fup")
DELETE= CALL DownDevice("pup")
UPDATE= CALL UpdateRec ("sqlci")
?PROC Perform (#KeyWords,rules)
{-------------------------}
PARM #KeyWords; { list of keywords to perform
PARM rules; { cache to search for rules
VAR #KeyWord := #TRIM #KeyWords
,#rule
, i
;
WHILE #KeyWord <> "" DO BEGIN { While keyword.
SEARCH rules { Search rules cache
CACHE #KeyWord &"=" { for keyword=
LINEFOUND #rule -> i; { #rule if found.
IF (i>=0) THEN BEGIN { Rule found
SCAN #rule UNTIL "=" -> i; { Scan for "="
EXECUTE #rule[i+1:132]; { EXE text past "="
END;
#KeyWord := #TRIM #KeyWords; { Get next word
END;
?SECT main
{---------}
CALL Perform( "ADD ADD ADD DELETE", rules);
FLUSH