开发者

What is the '#" symbol in Pascal?

开发者 https://www.devze.com 2023-01-02 20:24 出处:网络
For example: x := #123; I tried to search around Google but I simply have n开发者_运维问答o idea what this means.IIRC it means a character value of the number (eg. #32 -> space).#123 is a character

For example:

x := #123;

I tried to search around Google but I simply have n开发者_运维问答o idea what this means.


IIRC it means a character value of the number (eg. #32 -> space).


#123 is a character (Char type) of the ordinal value 123.


It's character code. #97 is equivalent to 'a' etc etc

A chart can be see here.


It is an extention to standard Pascal, Borland Pascal accepts the pound sign ('#') followed immediately by a decimal number between 0 and 255 as a single character with that code.


As other have mentioned it's a character code, I most often see them used for line breaks in messages, or other control character such as Tab (#9)

ShowMessage('Error:'#13#10'Something terrible happened')

Strangely it's not necessary to concatinate a string involving these.


It's character code. #97 is equivalent to chr(97) etc etc

0

精彩评论

暂无评论...
验证码 换一张
取 消