Recent

Author Topic: How to include strutils into Pascal Script?  (Read 5530 times)

palacs

  • New Member
  • *
  • Posts: 21
How to include strutils into Pascal Script?
« 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

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: How to include strutils into Pascal Script?
« Reply #1 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.

palacs

  • New Member
  • *
  • Posts: 21
Re: How to include strutils into Pascal Script?
« Reply #2 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?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: How to include strutils into Pascal Script?
« Reply #3 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