Lazarus

Programming => Packages and Libraries => Lazarus Extra Components => Topic started by: palacs on June 14, 2018, 10:58:37 am

Title: How to include strutils into Pascal Script?
Post by: palacs on June 14, 2018, 10:58:37 am
Hi All,

I would like to include unit strutils into a Pascal Script but I have not found any SIRegister_ or RIRegister_ functions (like RIRegister_stdctrls for unit stdctrls) that would import it. Is it even possible?

Thanks
Title: Re: How to include strutils into Pascal Script?
Post by: Leledumbo on June 14, 2018, 11:43:06 am
I guess you have to do it yourself. The original PascalScript package comes with a utility to generate import unit from existing one, but I can't find it in the one shipped with Lazarus. It was a Windows executable with no source AFAIR, probably that's why.
Title: Re: How to include strutils into Pascal Script?
Post by: palacs on June 14, 2018, 01:04:31 pm
Good to know it's possible.

Is there any step-by-step howto or documentation on how to do the import with that tool?

Have you (or anyone else) done this before?
Title: Re: How to include strutils into Pascal Script?
Post by: Leledumbo on June 15, 2018, 12:42:08 pm
Is there any step-by-step howto or documentation on how to do the import with that tool?
I cannot find a definitive one, so my advice would be to look at StrUtils' friend: DateUtils, which has both uPSR_dateutils and uPSC_dateutils as imported units for PascalScript. A small tutorial explaining the concept with actual code is here: https://lawrencebarsanti.wordpress.com/2009/11/28/introduction-to-pascal-script/
Have you (or anyone else) done this before?
Nope, never had a need before.
TinyPortal © 2005-2018