Pascal integer to string conversion

freepascallazaruspascal

Is there a built in function that converts integers to strings in Free Pascal, as in returns a string object of the integer input? I've scowered the Google and the docs for 2 hours now and have found nothing but false hope and disappointment. Using Lazarus 1.4.4 on Windows 10.

Also, why is pascal so complex/aggravating? There are tons of versions, IDEs, application support vs not application support, and the docs are mediocre at best (at least for Free Pascal, although Delphi's doesn't look too good at a glance either). It's so all over the place, it's like a giant tangled pair of earbuds.

Thank you!

Best Answer

As said there is inttostr, which is Delphi's way of doing it. The classic Pascal solution is str. Both work in FPC and Delphi, though inttostr might require a object oriented (Delphi alike) mode in FPC.

A string is not an object btw, but a first class native type.

Basically Lazarus/FPC and Delphi are the only really active native Pascal products. Typically the two last versions of Lazarus are in active use (1.4.4 and rc's for the upcoming 1.6). Some older versions are still visible on specially Debian and derivatives(because these versions are default in that Debian Stable).

For Delphi of course there are more versions in active use because a new version must be bought (in the Eur/$ 500-600 range).

The FPC docs are quite good, there are several thousands of pages (and the doxygen like tool is set not to generate pages without content). Lazarus has a different setting and generates also pages with skeleton info only.

For a totally self supported project (no major, continuous corporate sponsors, no dedicated FTEs, either directly it the project (like Firefox) or at sponsors (like e.g. LLVM) ) this is quite good.

Related Topic