Forum > General

Helper functions for Integers and other primitive types

(1/3) > >>

carl_caulkett:
* Mac Mini M1
* macOS 14.6.1
* Lazarus 3.99
* FPC 3.3.1

I notice that it is possible to use code such as "Count.ToString" where Count is an Integer. Is this done by something similar to class helpers, and can it be added to, or is it some "behind the scenes" IDE magic taking place?

TRon:
Those are typehelpers, defined in sysutils see also Class, Record and Type helpers or the wiki helper types

jamie:
you can add to them, btw.

TRon:
Indeed you can jamie but be aware that afaik trunk supports mutliple helpers while current release FPC requires subclassing the old typehelper in order to extend.

VisualLab:
In particular, type helpers work very well for your own enumeration types. I've been using them for a long time.

Navigation

[0] Message Index

[#] Next page

Go to full version