From 92f161131569505fbb5104a1b71f38d5c4276034 Mon Sep 17 00:00:00 2001 From: Curtis F Kaylor Date: Sun, 19 Sep 2021 22:05:35 -0400 Subject: [PATCH] argtest.c02 with prtbfr function --- test/argtest.c02 | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 test/argtest.c02 diff --git a/test/argtest.c02 b/test/argtest.c02 new file mode 100644 index 0000000..fdd126a --- /dev/null +++ b/test/argtest.c02 @@ -0,0 +1,47 @@ +/******************************************* + * ARGS - Test/Demo Command Line Arguments * + *******************************************/ + +//Specify System Header using -H option +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +char c,n,r; +char arg[128]; +int p; + +void prtbfr() { + for (n=0; n<#SYSBFL; n++) { + c = sysbfr[n]; + select (c) { + case 0: putc('@'); + default: if (c < ' ') putc('.'); + else putc(c);} + } + newlin(); +} + +main: + r,p = setarg(); + if (r) {putln("NO ARGS"); goto exit;} + + putln("ARGS"); + n = 0; + while () { + setsrc(p); p = strget(arg); + if (arg[0] == 0) break; + setdst(arg); printf(n, "%d %s%n"); + n++; + } + +goto exit; +