What is the '#" symbol in Pascal?

前端 未结 6 2210
太阳男子
太阳男子 2020-12-20 17:16

For example:

x := #123;

I tried to search around Google but I simply have no idea what this means.

相关标签:
6条回答
  • 2020-12-20 17:38

    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.

    0 讨论(0)
  • 2020-12-20 17:47

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

    0 讨论(0)
  • 2020-12-20 17:50

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

    0 讨论(0)
  • 2020-12-20 17:52

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

    A chart can be see here.

    0 讨论(0)
  • 2020-12-20 18:00

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

    0 讨论(0)
  • 2020-12-20 18:04

    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.

    0 讨论(0)
提交回复
热议问题