Recent

Author Topic: Where the Pointer type is declared? [solved]  (Read 2978 times)

MNeto

  • New Member
  • *
  • Posts: 18
Where the Pointer type is declared? [solved]
« on: August 21, 2015, 02:26:44 am »
Hello.

I am a new user of the Free Pascal and Lazarus.

I'm reading the documentation and learning the Object Pascal language used by Free Pascal.

My question is:

I know I can declare a pointer like this:

Code: [Select]
var p: Pointer;
But did not found the documentation for this type. What is he? A class?
What type is the "Pointer" type? I can not locate the unit where it is declared. What this type mean?

At another site, which also uses Pascal, is said to Pointer is a type declared in the System unit. But when I look at the Free Pascal documentation, I found nothing about it.

Thank you in advance.
« Last Edit: August 21, 2015, 05:37:19 pm by MNeto »

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: Where the Pointer type is declared?
« Reply #1 on: August 21, 2015, 02:58:16 am »
It is one of the built-in types, just like integer, boolean etc.
A pointer is just what it says, a pointer (to another data structure, variable etc.).
http://www.freepascal.org/docs-html/ref/refse15.html#x46-530003.4
« Last Edit: August 21, 2015, 03:00:40 am by eny »
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

MNeto

  • New Member
  • *
  • Posts: 18
Re: Where the Pointer type is declared?
« Reply #2 on: August 21, 2015, 04:12:47 pm »
Thanks for the answer.

My question was what types such as Integer, among others, are declared in the System unit. I could not find the declaration of 'Pointer' nowhere.

I know this is not a question so important. But really I got this curiosity.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11458
  • FPC developer.
Re: Where the Pointer type is declared?
« Reply #3 on: August 21, 2015, 04:24:41 pm »
My question was what types such as Integer, among others, are declared in the System unit. I could not find the declaration of 'Pointer' nowhere.

- Integer, like pointer is built-in, but it is redefined in the objpas system unit enhancement (unit objpas, automatically loaded for modes objfpc and delphi).

- some types are pseudo defined in system.fpd. This sourcefile is not really used except by the documentation system. It contains equivalent declarations for built-in types.  However the pointer type isn't defined there either.

So in summary, pointer is built-in without even a (re-)declaration for documentation purposes.

MNeto

  • New Member
  • *
  • Posts: 18
Re: Where the Pointer type is declared?
« Reply #4 on: August 21, 2015, 05:36:19 pm »
Thank you.
Now I understand.

 

TinyPortal © 2005-2018