Sign in Join
Wiki copytemporary

PtrInt: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: PtrInt

OldNewLine
1+The data types **[`ptrInt`](https://www.freepascal.org/docs-html/rtl/system/ptrint.html)** (“Peter Int”) and **[`ptrUInt`](https://www.freepascal.org/docs-html/rtl/system/ptruint.html)** (“Pee true Int”) are signed and unsigned [[Integer|integer]] [[Data type|data types]] respectively having the same [[SizeOf|sizeOf]] of a [[Pointer|pointer]].
2+
3+## application
4+
5+- Use `ptrUInt` if an `integer` value will eventually be [[Typecast|typecasted]] to a `pointer`.
6+- Regardless of the size taken up by its elements, an [[Array|array]] cannot have more than `high(ptrInt)` elements. Additionally, the range type must be a subrange of `ptrInt`.<sup>[1](https://www.freepascal.org/docs-html/current/user/userse62.html)</sup>
7+
8+## notes
9+
10+- `PtrInt`/`ptrUInt` are not necessarily the same size of `ALUSInt`/`ALUUInt`.
11+- The introduction of `ptrInt` was a mistake. New code should not use it.
12+- [`IntPtr`](https://www.freepascal.org/docs-html/rtl/system/intptr.html) and [`nativeInt`](https://www.freepascal.org/docs-html/rtl/system/nativeint.html) are aliases for `ptrInt`.
13+- [`UIntPtr`](https://www.freepascal.org/docs-html/rtl/system/uintptr.html) and [`nativeUInt`](https://www.freepascal.org/docs-html/rtl/system/nativeint.html) are aliases for `ptrUInt`.
14+- `PtrInt` and `ptrUInt` are redefined by the `unit` `unicodeData`.
15+
16+---
17+*From the Free Pascal wiki, page "PtrInt", as it stood on 2022-01-25 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
18+Category: Data types
19+Category: FPC

Back to history