put skip(2) list ('Delay Test:');
put skip list ('->a dot will be printed each second');
put list ('for ten seconds ');
do i = 1 to 10;
call delay (60);
put edit ('.') (a);
end;
put skip(2) list ('Console Test:');
put edit ('->current console is #',getcon())
(skip,a,f(2));
/**********************************
* *
* Send CLI Command Test: *
* This example shows how to run *
* a program in another memory *
* segment and then get the con- *
* sole back to the main program.*
* E.G. as in a menu driven *
* application. *
* *
**********************************/
dcl
1 clicmd,
2 dslct bit(8), /* default disk / user code */
2 console fixed(7), /* console number */
2 line char(128);
dcl
1 apb static,
2 console fixed(7),
2 name char(8) initial ('cli '),
2 match bit(8) initial ('00'b4);
put skip(2) list ('Send CLI Command Test:');
on endfile (sysin)
go to clresptst;
pdadr = rpdadr(); /* get current running pd adr */
oldpriority = pd.priority;
clicmd.dslct = pd.slct;
clicmd.console = pd.console;
apb.console = pd.console;
do while (true);
put skip list (' Enter CLI Command: ');
get edit (clicmd.line) (a);
if ~asncon (addr (apb)) then
do;
put skip list ('*** Failed to assign Cli the console ***');
end;
else
do;
call setpri (197);
call sclicd (addr (clicmd));
call attcon();
call setpri (oldpriority);
end;
end;
clresptst:
get edit (v) (a); /* clear input buffer */
put skip(2) list ('Call Resident System Process Test:');
call makque (addr (stringqcb));
stringuqcb.pointer = addr (stringqcb);
stringuqcb.msgadr = addr (stringprocadr);
stringprocadr = clresptest;
call wrque (addr (stringuqcb));
cpb.nameadr = addr (procname);
cpb.paramadr = addr (aparam);
aparam = addr (upper);
unspec (rtnstringadr) = clresp (addr (cpb));
put edit ('->STRING proc returned:',rtnstring)
(skip,a,a(27));
if ~delque (addr (stringqcb)) then
do;
put skip list ('*** Unable to delete stringqcb ***');
call term ('0000'b4);
end;
put skip list ('->Call clresp test complete.');
put skip(2) list ('Parse Filename Test:');
on endfile (sysin)
go to gettodtest;
put skip list (' Enter string of filenames to be parsed,');
put list ('separated by commas:');
do while (true);
put skip list ('->');
get edit (line) (a);
line = substr (line,1,index (line,' ')-1) || ascii (13);
pfcb.flname = addr (line);
pfcb.fcb = addr (afcb);
oldptr = addr (line);
done = false;
pfcb.flname = parse (addr (pfcb));
do while (~done & (unspec (pfcb.flname) ~= 'ffff'b4));
oldptr = pfcb.flname;
put edit (' ',ascii (afcb.drive+64),': ',
afcb.fname,' ',afcb.ftype)
(skip,a,a,a,a(8),a,a(3));
if unspec (pfcb.flname) = '0000'b4 then
do;
done = true;
end;
else
do;
delimptr = pfcb.flname;
if delim = ',' then
do;
unspec (i) = unspec (pfcb.flname);
i = i + 1;
unspec (pfcb.flname) = unspec (i);
end;
pfcb.flname = parse (addr (pfcb));
end;
end;
if ~done then
do;
put skip list (' *** Bad Entry *** ->');
put edit (old) (a(10));
end;
end;
/**********************************
* *
* Time and Date Test: *
* *
**********************************/
dcl
1 tod,
2 date fixed(15),
2 time,
3 hour bit(8),
3 min bit(8),
3 sec bit(8);
gettodtest:
get edit (v) (a); /* clear input buffer */
put skip(2) list ('Time and Date Test:');
call gettod (addr (tod));
put edit ('-> ',tod.date,' ',tod.hour,':',tod.min,':',tod.sec)
(skip,a,f(5),a,b4(2),a,b4(2),a,b4(2));