Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2002-05

How to do a cast in fpc (i'm just stuck in doors)

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michal Bukovjan
to marius popa: Want to do a cast from "VOID_POINTER" to "TFIBBASE" because of this error : Compiling…
marius popa wrote 26 lines
Want to do a cast from "VOID_POINTER" to "TFIBBASE" because of this error : Compiling fibdatabase.pp fibdatabase.pp(529,22) Error: Incompatible types: got "VOID_POINTER" expected "TFIBBASE" fibdatabase.pp(568,26) Error: Incompatible types: got "VOID_POINTER" expected "TFIBTRANSACTION" and here is my 529 offensing line : function TFIBDatabase.GetDataSet(Index: Integer): TFIBBase; begin result := FDataSets[Index]; end; where TFIBase is : TFIBBase = class(TObject) protected FDatabase: TFIBDatabase; ........................... end; and FDataSets is declared : FDataSets : TList;
Result:= TFIBDatabase(FDataSets[Index]);

does not work?

Michal

Reply by email

marius popa

Want to do a cast from "VOID_POINTER" to "TFIBBASE" because of this error :

Compiling fibdatabase.pp
fibdatabase.pp(529,22) Error: Incompatible types: got "VOID_POINTER" expected "TFIBBASE"
fibdatabase.pp(568,26) Error: Incompatible types: got "VOID_POINTER" expected "TFIBTRANSACTION"

and here is my 529 offensing line :

function TFIBDatabase.GetDataSet(Index: Integer): TFIBBase;
begin
  result := FDataSets[Index];
end;

where TFIBase is :
TFIBBase = class(TObject)

  protected
    FDatabase: TFIBDatabase;

...........................

  end;

and FDataSets is declared :

  FDataSets           : TList;

Reply by email