Solved

Pass pointers as parameters.

Posted on 2002-04-02
2
147 Views
Last Modified: 2010-04-04
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!
0
Comment
Question by:Kurtis
2 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 75 total points
ID: 6913554
as every tobject is a pointer to itself,
you don't need the ^-sign

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; //don't know for what this may be
 function ConsultaQ(Sentencia: TStrings;PQ:  TQuery):Integer; //error
end;

meikl ;-)
0
 

Author Comment

by:Kurtis
ID: 6913587
It was pretty simple.
Thanks kretzschmar!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question