再看李维的MTS/DELPHI5.x分布式开发的书时看到这两个函数, 但不知道用来干什么, 看帮助又看不清楚, 请大虾指教

解决方案 »

  1.   

    看看Delphi的HelpVarArrayHighBound returns the high bound of the given dimension in the given variant array. The Dim parameter should be 1 for the leftmost dimension, 2 for the second leftmost dimension, and so on. An exception is raised if the variant given by A is not an array (EVariantInvalidArgError), or if the dimension specified by Dim does not exist (EVariantBadIndexError).VarArrayLowBound returns the low bound of the given dimension in the given variant array. The Dim parameter should be 1 for the leftmost dimension, 2 for the second leftmost dimension, and so on. An exception is raised if the variant given by A is not an array (EVariantInvalidArgError), or if the dimension specified by Dim does not exist (EVariantBadIndexError)..
      

  2.   

    例如:
    procedure TForm1.Button1Click(Sender: TObject);
    var
      B: Variant;
    begin
      B := VarArrayCreate([1, 8], varVariant);
      ShowMessage(Format('%d/%d', [VarArrayLowBound (B, 1), VarArrayHighBound (B, 1)]));
    end;