1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-11-22 16:34:15 +00:00
C02/test/argtest.c02

48 lines
884 B
Plaintext
Raw Normal View History

2021-09-20 02:05:35 +00:00
/*******************************************
* ARGS - Test/Demo Command Line Arguments *
*******************************************/
//Specify System Header using -H option
#include <screen.h02>
#include <stddef.h02>
#include <stdlib.h02>
#include <intlib.h02>
#include <args.h02>
#include <ctype.h02>
#include <stdio.h02>
#include <stdiox.h02>
#include <string.h02>
#include <stringl.h02>
#include <stringm.h02>
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;