Chr$
Character = Chr$ ( Code AS Integer ) AS String
Character = Chr ( Code AS Integer ) AS String
返回ASCII码值为Code的字符。
该函数仅仅处理ASCII码字符。如果需要创建非ASCII码字符,例如类似德语元音变音,
必须使用
String.Chr函数。
错误
示例
' 本例打印ASCII码为65的字符,即字符A。
PRINT Chr$(65)
' 本例打印ASCII码值从32~126的字符。
'
DIM X AS Integer
FOR X = 32 TO 126
PRINT Chr$(X);
NEXT
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
' 本例说明特殊字符用法,Chr$(10)的作用像一个换行命令。
'
PRINT "This will print on line 1"; Chr$(10); "This will print on line 2"
This will print on line 1
This will print on line 2
参见