FindKey in fs_ibdertti

edited 1:09PM in FastScript
The "DoFindKey" function in "fs_ibdertti", is alreays sending an array with 32 values to the TTable.FindKey. The TTable component raised an "Field index out of range".

Please Help.
Christian


Comments

  • edited 1:09PM
    Change fs_itools.pas:
    type
      TVarRecArray = array of TVarRec;
    
    procedure VariantToVarRec(v: Variant; var ar: TVarRecArray);
    var
      i: Integer;
    begin
      SetLength(ar, VarArrayHighBound(v, 1) + 1);
    
      for i := 0 to VarArrayHighBound(v, 1) do
        case TVarData(v[i]).VType of
          varSmallint, varInteger, varByte:
            begin
              ar[i].VType := vtInteger;
              ar[i].VInteger := v[i];
            end;
          varSingle, varDouble, varCurrency, varDate:
            begin
              ar[i].VType := vtExtended;
              New(ar[i].VExtended);
              ar[i].VExtended^ := v[i];
            end;
          varBoolean:
            begin
              ar[i].VType := vtBoolean;
              ar[i].VBoolean := v[i];
            end;
          varOleStr, varString:
            begin
              ar[i].VType := vtString;
              New(ar[i].VString);
              ar[i].VString^ := v[i];
            end;
          varVariant:
            begin
              ar[i].VType := vtVariant;
              New(ar[i].VVariant);
              ar[i].VVariant^ := v[i];
            end;
        end;
    end;
    
    procedure ClearVarRec(var ar: TVarRecArray);
    var
      i: Integer;
    begin
      for i := 0 to Length(ar) - 1 do
        if ar[i].VType in [vtExtended, vtString, vtVariant] then
          Dispose(ar[i].VExtended);
      Finalize(ar);
    end;
    
  • edited 1:09PM
    ;)

    Thanks

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.