Set the automatic character counter register to zero (i.e. to nochars*)
Everytime that a character (Unicode we hope) is read from the input stream,
(by the nom commands read
or while
or whilenot
or
until
) the character counter register in the pep virtual machine
is incremented by one.
The “nochars” command sets the automatic character counter to zero. This is useful for making the character number relative to the line number. This is often more helpful than having a character count that starts from the beginning of the input stream. For example at the beginning of a script, we can put
read; [\n] { nochars; } print; clear;
chars; "60" { clear; add "\n"; print; }
clear;
read;
"\n" { nochars; }
"z" {
add "\n[Found a 'z' at line: "; lines; add ", char: "; chars;
add "]\n";
}
print; clear;