const EOS = '\0'; type string = packed array[0..MAXSTR] of char; var i : integer; n : integer; s : string; function itoc(n:integer; var s:string; max:integer):integer; extern; ... i := itoc(n, s, MAXSTR);
ITOC converts the integer "n" into a sequence of ASCII digits in the string "s", followed by an EOS character. At most "max" characters will be written into "s", not including the EOS character. ITOC returns the number of characters placed in the string, including the minus sign if "n" was negative. It does not include the '\0' character after the last digit. For the routine to work correctly, the array type used to define "string" MUST have origin 0.
Copyright © 1996, Thinkage Ltd.