3 (* encoding converter test *)
5 IMPORT Kernel
, HostLang
, Console
, Strings
;
9 VAR i
, j
, res
: INTEGER; p
, x
: ARRAY maxBuf
OF CHAR;
11 IF Kernel
.trapCount
# 0 THEN Kernel
.Quit(1) END;
13 WHILE i
< Kernel
.argc
DO
14 HostLang
.HostToString(Kernel
.argv
[i
]$
, p
, TRUE
, res
);
18 Console
.WriteStr("Error: "); Console
.WriteChar(CHR(ORD("0") + res
MOD 10));
24 IF i
> 1 THEN Console
.WriteLn
END;
27 WHILE i
< Kernel
.argc
DO
28 HostLang
.HostToString(Kernel
.argv
[i
]$
, p
, TRUE
, res
);
31 Strings
.IntToStringForm(ORD(p
[j
]), 16, 4, "0", FALSE
, x
);
33 Console
.WriteStr(" ");
38 IF i
> 1 THEN Console
.WriteLn
END;