Pas2js does not have functions Hi and Lo.
Original Reporter info from Mantis: Kryvichh
-
Reporter name:
Original Reporter info from Mantis: Kryvichh
- Reporter name:
Description:
Free Pascal as well as Delphi have build-in functions Hi and Low.
function Lo(X: Integer): Byte;
Returns the low-order Byte of argument X.
function Hi(X: Integer): Byte;
Returns the high-order byte of X as an unsigned value.
In Delphi code, use Hi to obtain the high-order byte of an expression of type Word or Integer.
Note: Hi treats Integer as a 16-bit value, even if it is 32-bit.
But Pas2js does not have these functions.
Steps to reproduce:
program TestHiLo;
const
LO_BYTE = Lo($1234); // Error: identifier not found "Lo"
HI_BYTE = Hi($1234); // Error: identifier not found "Hi"
// LO_BYTE = $1234 and $FF; // workaround for Lo(Word): Byte
// HI_BYTE = $1234 shr 8; // workaround for Hi(Word): Byte
begin
Writeln('Hello, world!');
Writeln('Lo = ', LO_BYTE, ', Hi = ', HI_BYTE);
end.
Additional information:
Please see the test application in the attachment.
Mantis conversion info:
- Mantis ID: 34924