SeeView Manual

SeeView Statements and Script Symbols
HP NonStop SeeView Manual526355-004
9-66
LOAD
This example shows a general procedure that can be called repeatedly to return
ascending blocks of logical devices in a cache named Ldevs.
LOAD
The LOAD statement loads or places a specified file into a cache associated with a
taskid.
filename
specifies the file to be loaded.
?menu Ldevs cache 10
?proc GetNextDevices(Type,Count,More)
{------------------------------------
{ This proc gets next block of logical devices of "Type".
{ Up to "Count" devices are returned in cache "Ldevs".
{ If "More" true, call again to get next block of Ldevs.
{-------------------------------------------------------------
parm Type IN { Device Type
,Count IN { Maximum number Ldevs to put in cache
,More := 0 OUT { <>0 implies more devs, call me again
;
var #List :="LISTDEV TYPE " & type &
" TO Ldevs MORE " & count &
" DETAIL START " { #Ldev
,#Ldev :="000000" { Start Ldev number
,#z { scratch vars #z, i, ..
,i
;
READ Ldevs CACHE -1,#z; { Look for <MORE?> from last call.
SCAN #z UNTIL "<MORE?>"->i;{ Scan last record for "<MORE?>"
IF (i) THEN BEGIN { If more, parse Ldev & clear cache
#Ldev:=#TAKE#z[10:20]; { Parse #Ldev from buffer
DELETE Ldevs!; { Clear for next set of Ldevs
END;
EXECUTE #List & #Ldev; { EXECUTE Listdev ... START <ldev>
READ Ldevs CACHE -1,#z; { Check if <MORE?> flag present
SCAN #z UNTIL "<MORE?>"->i;{ If <MORE?> found "i" nonzero.
IF (i) THEN More := 1; { More tells caller to call again
?SECT main
{---------
{ Example call GetNextDevices
{----------------------------
VAR more;
DO BEGIN
CALL GetNextDevices(0,22,more);
WINDOW Ldevs CACHE LAST;
{ ... Ldev processing logic goes here ... }
MSG #Time; FLUSH;
END UNTIL NOT (more);
MSG #TIME & " done";
LOAD filename , cache-taskid