别见笑,一个菜问题.
在delphi中$是什么意思?如:
const java=$400000
$400000啥意思?
问题点数:20、回复次数:3Top
1 楼dancemaple(枫之舞)回复于 2001-12-06 20:43:02 得分 5
美圆:)
开个玩笑
是十六进制Top
2 楼3fly(三飞)回复于 2001-12-06 20:56:17 得分 5
没错$123 = 1 * (16 * 16) + 2 * 16 + 3Top
3 楼NetFair(2006,成功转型!从事市场工作!坚持技术市场两手抓,两手都要硬方针!)回复于 2001-12-06 21:00:28 得分 10
he built-in assembler supports two types of constant: numeric constants and string constants.
Numeric constants
Numeric constants must be integers, and their values must be between ?,147,483,648 and 4,294,967,295.
By default, numeric constants use decimal notation, but the built-in assembler also supports binary, octal, and hexadecimal. Binary notation is selected by writing a B after the number, octal notation by writing an O after the number, and hexadecimal notation by writing an H after the number or a $ before the number.
Numeric constants must start with one of the digits 0 through 9 or the $ character. When you write a hexadecimal constant using the H suffix, an extra zero is required in front of the number if the first significant digit is one of the digits A through F. For example, 0BAD4H and $BAD4 are hexadecimal constants, but BAD4H is an identifier because it starts with a letter.
String constants
String constants must be enclosed in single or double quotation marks. Two consecutive quotation marks of the same type as the enclosing quotation marks count as only one character. Here are some examples of string constants:
'Z'
'Delphi'
"That's all folks"
'"That''s all folks," he said.'
'100'
'"'
"'"
String constants of any length are allowed in DB directives, and cause allocation of a sequence of bytes containing the ASCII values of the characters in the string. In all other cases, a string constant can be no longer than four characters and denotes a numeric value which can participate in an expression. The numeric value of a string constant is calculated as
Ord(Ch1) + Ord(Ch2) shl 8 + Ord(Ch3) shl 16 + Ord(Ch4) shl 24
where Ch1 is the rightmost (last) character and Ch4 is the leftmost (first) character. If the string is shorter than four characters, the leftmost characters are assumed to be zero. The following table shows string constants and their numeric values.
String Value
'a' 00000061H
'ba' 00006261H
'cba' 00636261H
'dcba' 64636261H
'a ' 00006120H
' a' 20202061H
'a' * 2 000000E2H
'a'-'A' 00000020H
not 'a' FFFFFF9EHTop




