{$R *.DFM}是什么意思?Address: Word;
Address := StrToInt('$' + Edit1.Text);
是什么意思?

解决方案 »

  1.   

    十六进制数的前缀,比如:var
      ASCII_CR : Byte;
      STR_CRLF : String;
    begin
      ASCII_CR := $0D;
      STR_CRLF := #$0D#$0A;    //或写成 STR_CRLF := chr($0D) + chr($0A);
    end;
      

  2.   

    Address := StrToInt('$' + Edit1.Text); 这一句我在调试时,
    Edit1.Text:=300,Address是768
    难道300的十六进制是768吗?300的十六进制不是等于12c的吗
      

  3.   

    请参考'$'符的帮助文档:
    1:'$'符作为十六制数据的表不符;
      如:
       var a:byte;
       a:=100;//给变量a赋值为100;同样也可以写成;
       a:=$64;//也就是说100可以用十六进制$64来表示,此时'$'就表示的是十六进制;
    2:'$'作为编译器指令定义符;
    如:{$R *.dfm} {$R backbmp.res}
    在上面表示的是告诉编译器一个信息,在编译时,把所有的窗体文件编译在EXE文件内,同时把名为backbmp.res资源文件也要编译在exe文件中;{$DEFINE  TEST}//这儿也是一种编译器指令的用法。简单地说:可以实现条件编译。
    procedure YourBtnClick(sender:tobject);
    begin
    {$IFDEF TEST}
     showmessage('test');
    {$ENDIF}
    end;
    类似的东西还有很多,下面来自于帮助文件:
    Conditional directives. These directives cause sections of code to be compiled or suppressed based on specified conditions, such as user-defined conditional symbols. See Conditional compilation for more information.All directives, except switch directives, must have at least one space between the directive name and the parameters. Here are some examples of compiler directives:{$B+}{$STACKCHECKS ON}
    {$R- Turn off range checking}
    {$I TYPES.INC}
    {$M 32768,4096}
    {$DEFINE Debug}
    {$IFDEF Debug}{$ENDIF}
    .............    
      

  4.   

    表示十六进制
    和C/C++里的0X一样
      

  5.   

    to cdelphic:
    Address := StrToInt('$' + Edit1.Text); 这一句我在调试时, 
    Edit1.Text:=300,Address是768 
    难道300的十六进制是768吗?300的十六进制不是等于12c的吗理解是错误的,'$' + Edit1.Text,如果Edit1.Text:=300,则表示
    Address为0x300,也就是说Edit1.Text应该是16进制的数,16进制的300
    当然十进制是768了啊。
      

  6.   

    dinglinger 让我知其所以然
    tuorx 让我知其然
    谢谢