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..
'Simple' Assignment
-
- Site Admin
- Posts: 525
- Joined: Fri Dec 31, 2010 12:30 pm
- Contact:
Re: 'Simple' Assignment
In Astrobe v4.3 and later BYTE is a regular data type so the above example can be written more simply as:
Code: Select all
MODULE Test;
CONST
ByteV = 22;
VAR
aByte: BYTE;
BEGIN
aByte := ByteV
END Test.