Kurtis
asked on
Pass pointers as parameters.
Hi again experts!
I want to make a function which executes an SQL sentence on any existing TQuery component. I'm attempting to pass a pointer to the TQuery object as a parameter, but the compiler gives me an error at the function prototype:
"Identifier expected but '^' found".
Here is the code:
type
TServeis = class(TObject)
private
{ Private declarations }
prova: ^TQuery; //this line compiles correctly
public
function BDEToStringList(Sentencia, Camp: String;var Llista: TStringList): Boolean;
function Cerca(Sentencia,Camp: String):Variant;
function ManipulaQ(Sentencia: TStrings;PQ: ^Integer):Integer; //error
function ConsultaQ(Sentencia: TStrings;PQ: ^TQuery):Integer; //error
end;
Any ideas are welcome! Thank you!
I want to make a function which executes an SQL sentence on any existing TQuery component. I'm attempting to pass a pointer to the TQuery object as a parameter, but the compiler gives me an error at the function prototype:
"Identifier expected but '^' found".
Here is the code:
type
TServeis = class(TObject)
private
{ Private declarations }
prova: ^TQuery; //this line compiles correctly
public
function BDEToStringList(Sentencia,
function Cerca(Sentencia,Camp: String):Variant;
function ManipulaQ(Sentencia: TStrings;PQ: ^Integer):Integer; //error
function ConsultaQ(Sentencia: TStrings;PQ: ^TQuery):Integer; //error
end;
Any ideas are welcome! Thank you!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks kretzschmar!