'Simple' Assignment
Posted: Sun Aug 14, 2011 7:05 pm
MODULE test;
IMPORT SYSTEM;
CONST
ByteV = 22;
VAR
aByte : SYSTEM.BYTE;
BEGIN
aByte := SYSTEM.VAL(SYSTEM.BYTE,ByteV);
END test.
The above code does work, but I find it hard to justify the needed SYSTEM.VAL type cast on a constant value.
where aByte := ByteV should do.
I think this just forces lazy/sloppy programming: Ok just slap in an INTEGER instead of a BYTE and it works. (without the type cast and without the !type cast! message..
IMPORT SYSTEM;
CONST
ByteV = 22;
VAR
aByte : SYSTEM.BYTE;
BEGIN
aByte := SYSTEM.VAL(SYSTEM.BYTE,ByteV);
END test.
The above code does work, but I find it hard to justify the needed SYSTEM.VAL type cast on a constant value.
where aByte := ByteV should do.
I think this just forces lazy/sloppy programming: Ok just slap in an INTEGER instead of a BYTE and it works. (without the type cast and without the !type cast! message..