Smart pascal source code
type
TEnum = (eZero, eOne, eTwo);
WriteLn(Ord('A'));
WriteLn(Ord(''));
WriteLn(Ord(123));
WriteLn(Ord(eTwo));
WriteLn(Ord(True));
WriteLn(Ord(False));
var v: Variant;
v := 456;
WriteLn(Ord(v));
v := 'a';
WriteLn(Ord(v));
v := '';
WriteLn(Ord(v));
v := True;
WriteLn(Ord(v));
v := False;
WriteLn(Ord(v));
v := PI;
try
WriteLn(Ord(v));
except
on e: Exception do
WriteLn(e.Message);
end;
{<<< RESULT - CONSOLE LOG >>>
-----------------------------
Errors >>>>
Hint: "PI" does not match case of declaration ("Pi") [line: 25, column: 4]
Result >>>>
65
0
123
2
1
0
456
97
0
1
0
3
-----------------------------
{<<<<<<<<< THE END >>>>>>>>>}
var v;
/* <<< main JS >>> */
WriteLn(65);
WriteLn(0);
WriteLn(123);
WriteLn(2);
WriteLn(1);
WriteLn(0);
v = 456;
WriteLn($Ord(v,""));
v = "a";
WriteLn($Ord(v,""));
v = "";
WriteLn($Ord(v,""));
v = true;
WriteLn($Ord(v,""));
v = false;
WriteLn($Ord(v,""));
v = 3.14159265358979;
try {
WriteLn($Ord(v,""));
} catch ($e) {
var e = $W($e);
WriteLn($Check(e,"").FMessage) }