Sign in Join
Wiki copytemporary

UInt8: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: UInt8

OldNewLine
1+Back to [[Data type|data types]].
2+
3+Range of values: 0 .. 255
4+
5+Memory requirement: 1 byte or 8 bit
6+
7+A [[Data field|data field]] of the **UInt8** data type can only contain positive integer values.
8+
9+Assigning other values ​​leads to compiler error messages when the program is compiled and the compilation process is aborted. That is, the executable program is not created.
10+
11+Definition of a data field of type UInt8:
12+
13+``` pascal
14+var
15+ ui8 : uint8;
16+```
17+
18+Examples of assigning valid values:
19+
20+``` pascal
21+ ui8 := 0;
22+ ui8 := 255;
23+```
24+
25+Examples of assigning invalid values:
26+
27+``` pascal
28+ ui8 := '0';
29+ ui8 := '255';
30+```
31+
32+The difference between the two examples is that the upper example is the assignment of literals of the type [[Integer]], while the assignment of the lower example is literals of the type [[String]].
33+
34+---
35+*From the Free Pascal wiki, page "UInt8", as it stood on 2020-03-02 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history