#13 是什么意思(100分)

  • 主题发起人 主题发起人 gxc418gxc
  • 开始时间 开始时间
G

gxc418gxc

Unregistered / Unconfirmed
GUEST, unregistred user!
#13 是什么意思 ? 不好意思,我在书上没有找到
 
#13 软回车,
#10 硬回车换行
#13#10 回车换行
 
#13回车
#10换行
 
抓取按鈕訊息就明白了.
 
A character string, also called a string literal or string constant, consists of a quoted string, a control string, or a combination of quoted and control strings. Separators can occur only within quoted strings.
A quoted string is a sequence of up to 255 characters from the extended ASCII character set, written on one line and enclosed by apostrophes. A quoted string with nothing between the apostrophes is a null string. Two sequential apostrophes in a quoted string denote a single character, namely an apostrophe. For example,

'BORLAND' { BORLAND }

'You''ll see' { You'll see }
'''' { ' }
'' { null string }
' ' { a space }

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. The control string

#89#111#117

is equivalent to the quoted string

'You'

You can combine quoted strings with control strings to form larger character strings. For example, you could use

'Line 1'#13#10'Line 2'

to put a carriage-return杔ine-feed between 揕ine 1?and 揕ine 2? However, you cannot concatenate two quoted strings in this way, since a pair of sequential apostrophes is interpreted as a single character. (To concatenate quoted strings, use the + operator or simply combine them into a single quoted string.)
A character string抯 length is the number of characters in the string. A character string of any length is compatible with any string type and with the PChar type. A character string of length 1 is compatible with any character type, and, when extended syntax is enabled ({$X+}), a nonempty character string of length n is compatible with zero-based arrays and packed arrays of n characters. For more information about string types, see String types.
 
你找本有ASCII码的书,#13就是ASCII码13号对应的东东——称做回车的家伙,其他以此类推
 
DELPHI里帮助解释的已经很清楚了,学过ASCII码就应该知道是怎么回事。
 
#13是回车键,你试一下这段代码体会体会:
procedure TForm1.Button1Click(Sender: TObject);
begin
label1.Caption:='第一行'+#13+'第2行' ;//一个#13就是一个回车键(即换行)[:D]
end;
 
一般要回车换行时就这样写。
 
回车
Enter键
 
一致通过[:D]
 
#13回车
#10换行
#8退格
#9TAB键
#27ESC键
其他的在FORM的KEYDOWN中写上
ShowMessage(inttostr(Key)) 看一下就知道了.
 
#13回车
#10换行
 
后退
顶部