Friday, May 15, 2020

What does #13#10 stand for, in Delphi code

Cryptic strings like 13#10 appear regularly within Delphi source code. These strings arent random gibberish, however — they serve an essential purpose for text layout. A control string is a sequence of one or more control characters, each of which consists of the # symbol followed by an unsigned integer constant from 0 to 255 (decimal or hexadecimal) and denotes the corresponding ASCII character. For example, to assign a two-line string to a Caption property of a TLabel control, use the following pseudocode: Label1.Caption : First line #13#10 Second line; The #13#10 part represents a carriage return line feed combination. The #13 is the ASCII equivalent of the CR (carriage return) value; #10 represents LF (line feed). Two more interesting control characters include: #0 — NULL character#9 — (horizontal) TAB

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.