有一过程中的几句我不理解,请高手指教!!!
procedure swapvar(var A1P,A2P;size:integer);
type
  a:array[1..maxint] of byte;
var
  A1:A absolute A1P;
  A2:A absolute A2P;
我就是不理解A1:A absolute A1P;
  A2:A absolute A2P;是什么意思?

解决方案 »

  1.   

    A1:A absolute A1P;  A1是A类型的一个参数,和A1P共享一块内存空间
      

  2.   

    absolute表示绝对地址或者一个变量和另一个变量使用相同地址你还可以这样看:
    可以用Absolute声明一个变量的绝对地址!
    例如:
    var
      str:string;
      i:byte Absolute str;
    上面声明的这种方式可靠,str这个变量可以不用,只做为i取地址用,
    这样比用绝对地址(如:var i:byte Absolute $0040:0040)声明可靠。
      

  3.   

    You can create a new variable that resides at the same address as another variable. To do so, put the directive absolute after the type name in the declaration of the new variable, followed by the name of an existing (previously declared) variable. For example,var
      Str: string[32];
      StrLen: Byte absolute Str;specifies that the variable StrLen should start at the same address as Str. Since the first byte of a short string contains the string's length, the value of StrLen is the length of Str.You cannot initialize a variable in an absolute declaration or combine absolute with any other directives.