Pointer type required

Hi,

I have this code from D7:

   for I := GlobalFunctionList.Count - 1 downto 0 do
     Dispose(PProfGridFunction(GlobalFunctionList.List^[I]))

In XE4 I get compiler error: Pointer type required

How should this code be changed to be correct for xe4?

Thanks
Rael
0
Rael
7/14/2015 1:54:14 AM
embarcadero.delphi.general 4258 articles. 0 followers. Follow

9 Replies
2169 Views

Similar Articles

[PageSpeed] 3
Get it on Google Play
Get it on Apple App Store

Rael wrote:

> I have this code from D7:
<snip>
> In XE4 I get compiler error: Pointer type required

What is GlobalFunctionList defined as?  I assume it is a TList (or descendant).

In Delphi 7, the TList.List property was defined as PPointerList, which was 
a pointer to a static array of pointers.

In Delphi XE2, the TList.List property was changed from PPointerList to TPointerList, 
which is a dynamic array of pointers.  This change is breifly mentioned in 
the documentation:

RTL Changes for XE2
http://docwiki.embarcadero.com/RADStudio/XE2/en/RTL_Changes_for_XE2

{quote}
The TList member FList is now of type TPointerList (it was PPointerList). 
{quote}

> How should this code be changed to be correct for xe4?

Remove the '^' operator when accessing the List[] property:

{code}
Dispose(PProfGridFunction(GlobalFunctionList.List[I]))
{code}

-- 
Remy Lebeau (TeamB)
0
Remy
7/14/2015 2:32:30 AM
On 2015/07/14 04:32 AM, Remy Lebeau (TeamB) wrote:
> Rael wrote:
>
>> I have this code from D7:
> <snip>
>> In XE4 I get compiler error: Pointer type required
>
> What is GlobalFunctionList defined as?  I assume it is a TList (or descendant).

Yes, sorry I forgot to mention that.

> In Delphi 7, the TList.List property was defined as PPointerList, which was
> a pointer to a static array of pointers.
>
> In Delphi XE2, the TList.List property was changed from PPointerList to TPointerList,
> which is a dynamic array of pointers.  This change is breifly mentioned in
> the documentation:
>
> RTL Changes for XE2
> http://docwiki.embarcadero.com/RADStudio/XE2/en/RTL_Changes_for_XE2
>
> {quote}
> The TList member FList is now of type TPointerList (it was PPointerList).
> {quote}
>
>> How should this code be changed to be correct for xe4?
>
> Remove the '^' operator when accessing the List[] property:
>
> {code}
> Dispose(PProfGridFunction(GlobalFunctionList.List[I]))
> {code}
>

Many thanks. Your knowledge is amazing. Do you get paid at all for your 
helping?
0
Rael
7/14/2015 2:54:44 AM
On 2015/07/14 04:32 AM, Remy Lebeau (TeamB) wrote:
> Rael wrote:
>
>> I have this code from D7:
> <snip>
>> In XE4 I get compiler error: Pointer type required
>
> What is GlobalFunctionList defined as?  I assume it is a TList (or descendant).

Yes, sorry I forgot to mention that.

> In Delphi 7, the TList.List property was defined as PPointerList, which was
> a pointer to a static array of pointers.
>
> In Delphi XE2, the TList.List property was changed from PPointerList to TPointerList,
> which is a dynamic array of pointers.  This change is breifly mentioned in
> the documentation:
>
> RTL Changes for XE2
> http://docwiki.embarcadero.com/RADStudio/XE2/en/RTL_Changes_for_XE2
>
> {quote}
> The TList member FList is now of type TPointerList (it was PPointerList).
> {quote}
>
>> How should this code be changed to be correct for xe4?
>
> Remove the '^' operator when accessing the List[] property:
>
> {code}
> Dispose(PProfGridFunction(GlobalFunctionList.List[I]))
> {code}
>

Many thanks. Your knowledge is amazing. Do you get paid at all for your 
helping?
0
Rael
7/14/2015 2:56:40 AM
On 2015/07/14 04:32 AM, Remy Lebeau (TeamB) wrote:
> Rael wrote:
>
>> I have this code from D7:
> <snip>
>> In XE4 I get compiler error: Pointer type required
>
> What is GlobalFunctionList defined as?  I assume it is a TList (or descendant).

Yes, sorry I forgot to mention that.

> In Delphi 7, the TList.List property was defined as PPointerList, which was
> a pointer to a static array of pointers.
>
> In Delphi XE2, the TList.List property was changed from PPointerList to TPointerList,
> which is a dynamic array of pointers.  This change is breifly mentioned in
> the documentation:
>
> RTL Changes for XE2
> http://docwiki.embarcadero.com/RADStudio/XE2/en/RTL_Changes_for_XE2
>
> {quote}
> The TList member FList is now of type TPointerList (it was PPointerList).
> {quote}
>
>> How should this code be changed to be correct for xe4?
>
> Remove the '^' operator when accessing the List[] property:
>
> {code}
> Dispose(PProfGridFunction(GlobalFunctionList.List[I]))
> {code}
>

Many thanks. Your knowledge is amazing. Do you get paid at all for your 
helping?
0
Rael
7/14/2015 3:04:12 AM
On 2015/07/14 04:32 AM, Remy Lebeau (TeamB) wrote:
> Rael wrote:
>
>> I have this code from D7:
> <snip>
>> In XE4 I get compiler error: Pointer type required
>
> What is GlobalFunctionList defined as?  I assume it is a TList (or descendant).

Yes, sorry I forgot to mention that.

> In Delphi 7, the TList.List property was defined as PPointerList, which was
> a pointer to a static array of pointers.
>
> In Delphi XE2, the TList.List property was changed from PPointerList to TPointerList,
> which is a dynamic array of pointers.  This change is breifly mentioned in
> the documentation:
>
> RTL Changes for XE2
> http://docwiki.embarcadero.com/RADStudio/XE2/en/RTL_Changes_for_XE2
>
> {quote}
> The TList member FList is now of type TPointerList (it was PPointerList).
> {quote}
>
>> How should this code be changed to be correct for xe4?
>
> Remove the '^' operator when accessing the List[] property:
>
> {code}
> Dispose(PProfGridFunction(GlobalFunctionList.List[I]))
> {code}
>

Many thanks. Your knowledge is amazing. Do you get paid at all for your 
helping?
0
Rael
7/14/2015 3:25:44 AM
Rael Bauer wrote:

> Many thanks. Your knowledge is amazing. Do you get paid at all for
> your helping?

No, TeamB does not get paid. We are volunteers. We do get the products
we are supporting, though.

-- 
Rudy Velthuis        http://www.rvelthuis.de

"If everyone demanded peace instead of another television set,
 then there'd be peace."
 -- John Lennon
0
Rudy
7/14/2015 1:47:33 PM
Rael Bauer wrote:

> Many thanks. Your knowledge is amazing. Do you get paid at all for
> your helping?

No, TeamB does not get paid. We are volunteers. We do get the products
we are supporting, though.

-- 
Rudy Velthuis        http://www.rvelthuis.de

"If everyone demanded peace instead of another television set,
 then there'd be peace."
 -- John Lennon
0
Rudy
7/14/2015 4:06:58 PM
Rael Bauer wrote:

> Many thanks. Your knowledge is amazing. Do you get paid at all for
> your helping?

No, TeamB does not get paid. We are volunteers. We do get the products
we are supporting, though.

-- 
Rudy Velthuis        http://www.rvelthuis.de

"If everyone demanded peace instead of another television set,
 then there'd be peace."
 -- John Lennon
0
Rudy
7/14/2015 4:12:01 PM
Rael Bauer wrote:

> Many thanks. Your knowledge is amazing. Do you get paid at all for
> your helping?

No, TeamB does not get paid. We are volunteers. We do get the products
we are supporting, though.

-- 
Rudy Velthuis        http://www.rvelthuis.de

"If everyone demanded peace instead of another television set,
 then there'd be peace."
 -- John Lennon
0
Rudy
7/14/2015 4:12:22 PM
Reply:

Similar Artilces:

Parameter type pointer to structure C / Delphi 2009
I have a function in a DLL made in C. This function recive a parameter type pointer to structure. The structure is: struct Currency { char Symbol[16]; char FileName[64]; char Value[2]; }; In Delphi 2009, this record, is equivalente? : _SRamCurrency = record Symbol: String[16]; FileName: String[64]; Value: String[2]; end; Is Equivalent? Is well? Jose "Jose Castillo Reyes" <josecastilloreyes@gmail.com> wrote in message news:128077@forums.codegear.com... > In Delphi 2009, this record, is equivalente? : Not exactly. Delphi ...

Confusion with: @Pointer, ^pointer, pointer^ and addr(pointer)..
Hi guys, Thanks for taking the time to read my post. I am using OpenCV with Delphi with a reasonable amount of success. However, this simple bit of code below will not run correctly due to passing PcvPoints to TcvPoints. I think I am doing something wrong with the pointers. Maxloc in the 'cvminmaxloc' function is a pointer to a Type cvPoint, and it has the properties cvPoint(integerX,integerY). Rather than the pointer, I need to pass TcvPoint to the cvRectangle function. Does anyone have any idea where I am going wrong? {code} unit TemplateMatching;  ...

What generals generally do
Reading a McChrystal thread elsewhere, I came across someone quoting a US general http://en.wikipedia.org/wiki/Smedley_Butler > I spent 33 years and four months in active military service and > during that period I spent most of my time as a high class thug for > Big Business, for Wall Street and the bankers. In short, I was a > racketeer, a gangster for capitalism. I helped make Mexico and > especially Tampico safe for American oil interests in 1914. I helped > make Haiti and Cuba a decent place for the National City Bank boys to > collect revenues in. I ...

Pointers to pointers.
PowerBuilder handles pointers implicitly. An object reference variable is a pointer to that object. But is it possible in PowerBuilder to have a pointer to a pointer? I have an object that holds a reference to a second object. The exact type of the second object changes between various descendants of the same ancestor. Now this reference is passed to a third object. I would like the change in the reference to the second object in the first object to be reflected in the reference in the third object. But what actually happens is that what gets passed to the third object i...

delphi.general
Sorry if this is "out of topic"! but since some days ago I can't read the group *embarcadero.public.delphi.language.delphi.general* Does anybody know if there's something wrong with it? Or maybe is my reader? (Thunderbird) I get this messagge when I try to read the latest messages: Error! newsgroup server responded:no such article found Perhaps the article has expired <692702@forums.embarcadero.com> (33145) Click here to remove all expired articles sergio wrote: > Sorry if this is "out of topic"! but since some days ago I can'...

pointer to pointer
I'd like to use an external function which has an argument of a pointer to a pointer which in C is declared as ptrStruct ** pointervar where ptrStruct is a pointer to a structure:structure * ptrStruct I've tried passing a ref var in the function whose type is a structure but i always seem to get the address of the variable. In the C examples of the external function the pointer to a pointer is used as an array: for(ctr=0;condition;ctr++){ pointervar[ctr] } How do you think can i implement this in PB? Here's an example of what i want to achieve in PB: http://www.lead...

Delphi 6 to Delphi XE2: can't find required package.
We have a Delphi 6 Project Group that we like to work on in Delphi XE2. When trying to build the project, we get the DCC Fatal Error E2202: Required package 'cds' not found. With Delphi 6 we've used the following tools: - JVCL340 & JCL221 - devExpress QuantumGrid 6 - QuickReport (default in Delphi 6) - Visoco Sybase Driver, Devart Oracle en MSSQL drivers With Delphi XE2 (update 3 installed) we're using the following tools and settings for now (after removing Delphi 6 in an attempt to make it work) : - JVCL345 & JCL231 (http://jvcl.delphi-jedi.org/) - devExpr...

Handles clause requires a WithEvents variable defined in the containing type or one of its base types
I am getting two errors (same) in my code behind VB of a CreateUserWizard control page.I was not getting these errors until I attempt to add an <asp:AccessDataSource> control to the page.  The reason for adding the control is that I need to add additional User Information for "membership" users on certain sections of my website.In searching the Forum and other ASP.NET  related sites, i could not find a solution to my problem. Following are the error codes, code behind VB and .ASPX page files.Does any one have an idea of how I can resolve these errors and whethe...

Handles clause requires a WithEvents variable defined in the containing type or one of its base types.
I'm getting this error in my vb.net page.  I have a listview that displays data from my sql db.  In addition to the databound columns, I added a radiobuttonlist and a text box, which is not visible.  If the user selects a certain radiobutton, I then want to display the text box.  My code is below...  why can't it find the radiobutton or text box?   my .aspx<tr><td>&nbsp;</td><td><asp:RadioButtonList ID="rbAnswer" runat="server"><asp:ListItem Text="No Information" Value="0"></asp:ListItem><asp:ListItem Text ="Yes, Will Reply Now" Value="1"></asp:ListItem><asp:ListItem Text = "Yes, Will Send Later" Value="2"></asp:ListItem></asp:RadioButtonList><asp:TextBox ID="txtMoreInfo" runat="server" Visible = "False"></asp:TextBox></td></tr> and my codebehind Protected Sub rbAnswer_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rbAnswer.SelectedIndexChangedIf rbAnswer.SelectedValue = 1 Thentxt.MoreInfo.Visible = TrueEnd IfEnd Sub  Never make important decisions on a Monday! Try this Protected Sub rbAnswer_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rbAnswer.SelectedIndexChanged Dim rbAnswer as RadioButton  = Ctype(sender, RadioButton )If rbA...

BC30506: Handles clause requires a WithEvents variable defined in the containing type or one of its base types.
 Hello I'm new to asp and I can't find a solution for the following problem. When I open the page in the browser i recieve this error message: BC30506: Handles clause requires a WithEvents variable defined in the containing type or one of its base types. Regel 13: <script runat="server"> Regel 14: Regel 15: Protected Sub insertbutton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.ClickRegel 16: Regel 17: I know that I need to define WithEvent variable but I don't know how! Here's the source c...

BC30506: Handles clause requires a WithEvents variable defined in the containing type or one of its base types.
why do i get BC30506: Handles clause requires a WithEvents variable defined in the containing type or one of its base types. with the code  below ..thanks  <form id="form1" runat="server">    <div>               <asp:Button ID="Button1" runat="server" Text="Run Access" />    </div>    </form>In your code behind:     Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click        Dim access As New Process        access.StartInfo.FileName = "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"        access.StartInfo.Arguments = "C:\Mydatabase.mdb"        access.Start()    End SubSome notes: Be sure to set the correct path to the MSACCESS.EXE. It all depends on your Office version. For a list of command-line switches to Microsoft Access see this page: http://support.microsoft.com/kb/209207 By default, starting a process this way will show the Access window on the server. If you want to control this, you should do:access.StartInfo.CreateNoWindow = TrueGood luck!  See these links: But basically: Dim WithEvents But...

error BC30506: Handles clause requires a WithEvents variable defined in the containing type or one of its base types.
I see this question posted a lot with presumably helpful answers, but I can't seem to make 'em work.  It seems that the issue most people are asking happens when they are programatically declaring / instantiating controls -- the standard solution is to add a "Public WithEvents" declaration to the code-behind page.  I am simply using the visual designer to create the gridview, so I thought I understood that the gv was implicitly declared as withevents.  No matter what I try, the page won't compile if I attempt to sling event code for my GV. The GV ...

Error 1 Handles clause requires a WithEvents variable defined in the containing type or one of its base types.
 I can't remember changing anything significant to my project, but now whichever aspx page I open, I get the error: Error    1    Handles clause requires a WithEvents variable defined in the containing type or one of its base types.     There is no masterpage/stylesheets so every page is individual and I just can't understand why it's coming up with this error whenever I try to debug any page!? Thanks   seem to have fixed this. controlz:  seem to have fixed this. I am very glad to hear ...

Help Required
Server Error in '/' Application.--------------------------------------------------------------------------------Unable to cast object of type 'System.Web.Compilation.BuildResultCompiledAssembly' to type 'System.Web.Util.ITypedWebObjectFactory'. [InvalidCastException: Unable to cast object of type 'System.Web.Compilation.BuildResultCompiledAssembly' to type 'System.Web.Util.ITypedWebObjectFactory'.] System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +123 System.Web.Compilation.BuildMa...

superreview cancelled: [Bug 223097] Interface for checking a Node against a XML Schema type : [Attachment 172012] Doesn't require a loaded schema file if the type to validate against is a built-in ty
Doron Rosenberg (IBM) <doronr@gmail.com> has cancelled Doron Rosenberg (IBM) <doronr@gmail.com>'s request for superreview: Bug 223097: Interface for checking a Node against a XML Schema type https://bugzilla.mozilla.org/show_bug.cgi?id=223097 Attachment 172012: Doesn't require a loaded schema file if the type to validate against is a built-in type. https://bugzilla.mozilla.org/attachment.cgi?id=172012&action=edit ...

superreview requested: [Bug 223097] Interface for checking a Node against a XML Schema type : [Attachment 172012] Doesn't require a loaded schema file if the type to validate against is a built-in ty
Doron Rosenberg (IBM) <doronr@gmail.com> has asked Peter Van der Beken <peterv@propagandism.org> for superreview: Bug 223097: Interface for checking a Node against a XML Schema type https://bugzilla.mozilla.org/show_bug.cgi?id=223097 Attachment 172012: Doesn't require a loaded schema file if the type to validate against is a built-in type. https://bugzilla.mozilla.org/attachment.cgi?id=172012&action=edit ------- Additional Comments from Doron Rosenberg (IBM) <doronr@gmail.com> Doesn't require a loaded schema file if the type to validate against is a b...

Smart pointers in Delphi
Hi all, there is floating an interesting language enhancement though the web today. Is there a chance to get that within a certain time frame into the Delphi compiler? I have summarize the most interesting sites: Proposal for Automated Variables http://www.deltics.co.nz/blog/?p=412 An Auto-Cancelling Hourglass http://www.deltics.co.nz/blog/?p=404 Smart pointers in Delphi http://barrkel.blogspot.com/2008/09/smart-pointers-in-delphi.html Boehm Garbage Collector from Barry Kelly original site: http://www.hpl.hp.com/personal/Hans_Boehm/gc/ delphi wrapper in CC: 21646_api...

String Type pointers
Hi, I'm trying to use pointers to string types but my problem is setting the correct form to allocate memory. Example, Creating new double variable to store in a list is this the correct form? List: TList; procedure AddNewText(Text: string); var Temp: PString; begin GetMem(Temp, Length(Text)); Temp^ := Text; List.Add(Temp); end; procedure TForm1.FormCreate(Sender: TObject); begin List := TList.Create; end; procedure TForm1.Button1Click(Sender: TObject); var i: Integer; begin for i := 0 to 100000 do AddNewText('Plim! Blowing cpu memo...

Generalized type helpers?
In the same vein as class helpers, what would you think of generalizing class helpers into type helpers? Some pseudo-code to illustrate: type TIntegerHelper = class helper for Integer function ToString : String; end; function TIntegerHelper.ToString : String; begin Result:=IntToStr(Self); end; would allow to write myIntVar.ToString (2).ToString without boxing or anything fancy involved, only syntaxic sugar, the compiler/parser would merely turn function TIntegerHelper.ToString : String; internally into class...

How do you validate a type but have it not required?
I have a textbox where the user would fill in a date. I need to make sure the text is a valid date if it is entered but it can't be a required fireld. If I use a comparevalidator for type I get an error on the page when it is left blank saying that "" can't be converted to a date format. Anyone know how to get around this? Did u try regular expression validator. That gets triggered only if u type some data in the field. Are you certain that it is your validator that is throwing the error? The whole point of a validator is to check if a value matches what you want it to ma...

role requiring a type
--_000_01EF6156B387B14E8278ECC376793BE18F539FE1exmb2adoicronca_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I want to define a role that will use a type defined by its consumer. Is this possible, and if so, what is the syntax to code it? Here's an example of what I'm trying to achieve: package Generic::Parent; use Moose::Role; require 'CHILD_CLASS'; has 'children' =3D> ( is =3D> 'ro', isa =3D> "HASHREF[$CHILD_CLASS]", ); .... package Generic::Child...

Pointers, Delphi 7
I have a major software package used by veterinary clinics, and have never used pointers in it. I would like to know is there is an advantage to using pointers, and if so, where? A major part of the app is invoicing. Each time an invoice is opened I store the Clients last name Clients first name Clients number Patient's (pet) name Patient's number to variables and use them frequently as the invoice is built and posted. Where in this process can I (and should I) use pointers? Also, as I read on pointers I see a lot of GetMem and FreeMem stuff. But...

delphi.general Timer
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --JivePart=_202d5.zeB8CwDOH5aMJzMl Content-Type: text/plain; charset="Utf-8" For Paolo Valle --JivePart=_202d5.zeB8CwDOH5aMJzMl Content-Type: application/octet-stream; name="SubroutineTimer.pas" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="SubroutineTimer.pas" dW5pdCBTdWJyb3V0aW5lVGltZXI7DQoNCmludGVyZmFjZQ0KDQpwcm9jZWR1cmUgU3RhcnRTdWJy b3V0aW5lVGltZXI7DQpmdW5jdGlvbiBHZXRTdWJSb...

pack / for general types
This patch allows len/format to work for any format type, not just strings. Basically for the non-string types it tries to gobble up all arguments that are left, unless you give an explicit repeat count. It also makes the * optional in the format. It's not paranoid about what exactly the format is since unpack isn't either. Quick, predict what this outputs: perl -wle 'print for unpack("aX/a*", "6abcdefghijkl")' This shouldn't break anything since it only makes things that used to be illegal work. Patches for blead and stable attached: ...

Web resources about - Pointer type required - embarcadero.delphi.general

No Jacket Required - Wikipedia, the free encyclopedia
No Jacket Required is the third solo studio album by English singer-songwriter Phil Collins , the lead vocalist and drummer for the rock band ...

Third-Party Apps No Longer Required To Create Facebook Promotions
Facebook Tuesday announced updated guidelines for promotions on the social network, and the most prominent change was the removal of the requirement ...

Release: @Wyoming_DEQ required to hold... - Powder River Basin Resource Council - Facebook
Release: @Wyoming_DEQ required to hold new public hearing for #coal gasification project Citizens Win Public Hearing on Proposed Aquifer Exemption ...

Action required for new Graph API Webhooks
Action required for new Graph API Webhooks

Facebook opens up promotions policy; third-party apps no longer required
Another step in its simplification process , Facebook is making it easier for pages to run promotions or contests , by removing the requirement ...

UP - Tracker Required (UP/UP24/UP MOVE) on the App Store on iTunes
Get UP - Tracker Required (UP/UP24/UP MOVE) on the App Store. See screenshots and ratings, and read customer reviews.

Chimney Sweep Not Required - Flickr - Photo Sharing!
From the Metis Powwow in Big Valley, Alberta.

Paul Craig Roberts: Manning was required to report crimes - YouTube
Iran by many is considered to be technologically inferior to most countries around the world. But earlier this month, Iran was able to hack the ...

Urgent action is required to help Arab Christians
Muslims have a key role to play in preserving a continued Christian presence in the Middle East, writes Michael Young

Men of dollars, and sense, required
It has taken rugby league more than 100 years to reach prudent adulthood. On Wednesday night, the NRL season launch at Sydney's Star casino is ...

Resources last updated: 2/16/2016 8:33:15 AM