Solved

Pass pointers as parameters.

Posted on 2002-04-02
2
149 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

789 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