Byte Data Type
Version: Available or changed with runtime version 1.0.
Stores a single, 8-bit character as a value in the range 0 to 255. You can easily convert this data type from a number to a character and vice versa. This means you can use mathematical operators on Byte variables.
Example
The following example assumes that you have a Byte variable named B and a Text variable named S.
You can assign a constant string of the length 1 to a Byte variable, as shown in the first line of the following code example. You can assign a single character in a Text or Code variable to a Byte variable, as shown in the second line of the following code example. You can assign a numeric value to a Byte variable, as shown in the third line of the following code example. This causes the Byte variable to contain the character from the ASCII character set that corresponds to the numeric ASCII code.
B := 'A';
B := S[2];
B := 65;
You cannot assign a character to a position greater than the position of the null terminator. For example, if the value of the text variable MyText is 'abc', then the null terminator is at position 4 and the following assignment causes a run-time error to occur.
MyText[5] := 'e';
See Also
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈