declare dcl literally 'declare', lit literally 'literally'; dcl tabflag byte public; dcl tabvector(21) byte public initial (18,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4); dcl tabsym byte public initial (';'); /************************************************************** * get$delimeter - defines the tab symbol * **************************************************************/ getdelimeter: procedure public; dcl i byte; i = 0; do while lbuff(i) <> eos and lbuff(i) <> ' '; i = i + 1; end; do while lbuff(i) = ' ' and lbuff(i) <> tab; i = i + 1; end; if lbuff(i) > ' ' then tabsym = lbuff(i); /* any printable char */ end getdelimeter; /************************************************************* * countable - compute the table arguments command * ***************************************************************/ count$table: procedure public; declare (i,ptr) byte, nvalue byte, totalval byte; i = 0; ptr = 0; totalval = 0; do while 1; /* valid argument if nvalue > 0 */ do while lbuff(i) <> ' ' and lbuff(i) <> tab; /* throw away undesired character */ i = i + 1; end; /* increment i to next first nonblank character */ do while lbuff(i) = blank or lbuff(i) = tab; i = i + 1; end; /* encounter first nonblank character */ nvalue = ctoi(i); if nvalue = 0 then do; if ptr = 0 then return; tabvector(0) = ptr; return; end; totalval = totalval + nvalue; if totalval <= 126 then do; ptr = ptr + 1; if ptr <= 20 then tab$vector(ptr) = nvalue; else do; tabvector(0) = 20; return; end; end; else do; if ptr > 0 then tabvector(0) = ptr; return; end; end; end counttable;