Recent

Author Topic: String Function Documentation  (Read 1592 times)

dgrhoads

  • New Member
  • *
  • Posts: 30
String Function Documentation
« on: August 12, 2019, 04:01:45 am »
The TYPE STRING has many associated functions which include:

VAR
st  : STRING;
BEGIN
// a few of the string functions are listed below.
st.IndexOF(...)
st.IndexOfAny (...)
st.Length
st.Compare (...)
etc.

These functions are displayed when one types the period after the "st" in the editor.  It would be very useful to see the documentation for them as the listing of arguments is often insufficient to know how they are used.

I would be deeply grateful if someone could point me to where all the many functions associated with STRING are documented.  I did not see them documented in the SourceForge documentation for the indexes of fcl, rtl or lcl.

ASBzone

  • Hero Member
  • *****
  • Posts: 678
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: String Function Documentation
« Reply #1 on: August 12, 2019, 04:27:40 am »
The TYPE STRING has many associated functions which include:

You may find the following instructive, or at least a good start...

https://forum.lazarus.freepascal.org/index.php?topic=39100.0   (especially this thread)
https://www.freepascal.org/docs-html/rtl/classes/tstrings.indexof.html
https://wiki.freepascal.org/String
-ASB: https://www.BrainWaveCC.com/

Lazarus v2.2.7-ada7a90186 / FPC v3.2.3-706-gaadb53e72c
(Windows 64-bit install w/Win32 and Linux/Arm cross-compiles via FpcUpDeluxe on both instances)

My Systems: Windows 10/11 Pro x64 (Current)

dgrhoads

  • New Member
  • *
  • Posts: 30
Re: String Function Documentation
« Reply #2 on: August 12, 2019, 05:11:42 am »
Thanks.  I checked them out.

Your second reference is to TStrings which is significantly different from STRING.
Your third reference had a few functions, but nowhere near the full list that is potentially available.

Is there a reason why documentation of STRING and all its functions should not be included in either the RTL or FTL index of objects?

Any other suggestions.

RAW

  • Hero Member
  • *****
  • Posts: 868
Re: String Function Documentation
« Reply #3 on: August 12, 2019, 05:38:15 am »
http://www.delphibasics.co.uk/Article.asp?Name=Text
http://www.delphibasics.co.uk/ByFunction.asp?Main=Strings
http://www.delphibasics.co.uk/ByFunction.asp?Main=Strings&Sub=Calcs
https://www.programering.com/a/MDO5EjNwATI.html
http://www.marcocantu.com/epascal/English/ch07str.htm

In general nobody here cares about Strings. Strings are deprecated and very important the next version 2.0.5 will not have any Strings at all, because nobody needs this ancient bullshit anymore... GET OVER IT !!!
Windows 7 Pro (x64 Sp1) & Windows XP Pro (x86 Sp3).

dsiders

  • Hero Member
  • *****
  • Posts: 1052
Re: String Function Documentation
« Reply #4 on: August 12, 2019, 06:09:51 am »
Thanks.  I checked them out.

Your second reference is to TStrings which is significantly different from STRING.
Your third reference had a few functions, but nowhere near the full list that is potentially available.

Is there a reason why documentation of STRING and all its functions should not be included in either the RTL or FTL index of objects?

Any other suggestions.

I believe what you're asking for is in TStringHelper, and it is documented at: https://www.freepascal.org/docs-html/current/rtl/sysutils/tstringhelper.html
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: String Function Documentation
« Reply #5 on: August 12, 2019, 07:57:51 am »
Yes, that is the correct link.
They are part of the fthe sysutils unit. They are  Delphi compatible.
That means you can also use the Delphi documentation and examples.
http://docwiki.embarcadero.com/Libraries/Tokyo/en/System.SysUtils.TStringHelper_Methods
« Last Edit: August 12, 2019, 08:02:50 am by Thaddy »
Specialize a type, not a var.

simone

  • Hero Member
  • *****
  • Posts: 573
Re: String Function Documentation
« Reply #6 on: August 12, 2019, 09:42:49 am »

In general nobody here cares about Strings. Strings are deprecated and very important the next version 2.0.5 will not have any Strings at all, because nobody needs this ancient bullshit anymore... GET OVER IT !!!


Do you refer to TStrings, the abstract base class from which TStringList descends?
Microsoft Windows 10 64 bit - Lazarus 3.0 FPC 3.2.2 x86_64-win64-win32/win64

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: String Function Documentation
« Reply #7 on: August 12, 2019, 09:59:57 am »

In general nobody here cares about Strings. Strings are deprecated and very important the next version 2.0.5 will not have any Strings at all, because nobody needs this ancient bullshit anymore... GET OVER IT !!!


Do you refer to TStrings, the abstract base class from which TStringList descends?
Don't know what they're ranting about, cause it makes no sense in any way except if it should have been meant ironic...

simone

  • Hero Member
  • *****
  • Posts: 573
Re: String Function Documentation
« Reply #8 on: August 12, 2019, 10:17:27 am »
I also don't understand... If TString is deprecated, then also TStringList is... What is his replacement? Generic containers?
Microsoft Windows 10 64 bit - Lazarus 3.0 FPC 3.2.2 x86_64-win64-win32/win64

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: String Function Documentation
« Reply #9 on: August 12, 2019, 11:18:28 am »
That was a joke - or stupid - . Easy string handling is a core feature of the Pascal language and always will be.
Specialize a type, not a var.

RAW

  • Hero Member
  • *****
  • Posts: 868
Re: String Function Documentation
« Reply #10 on: August 12, 2019, 02:50:08 pm »
Oh, did I miss something? This  :D or that  :P or these  :) :)  ... mmmh, so funny ...
Anyway.. sue me !
Windows 7 Pro (x64 Sp1) & Windows XP Pro (x86 Sp3).

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: String Function Documentation
« Reply #11 on: August 12, 2019, 04:17:09 pm »
This functionality is implemented by so called "helpers".

If I look in my last snapshot of the FPC trunk documentation, open rtl.chm and search for "string helper", I see a "tstringhelper" in the list, and if I click that the documentation opens. See screenshot

ASBzone

  • Hero Member
  • *****
  • Posts: 678
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: String Function Documentation
« Reply #12 on: August 14, 2019, 02:00:55 am »
Thanks.  I checked them out.
...
Any other suggestions.

But you appear to have missed the TStringHelper link that was referenced in that first thread, and contains the info you seek
-ASB: https://www.BrainWaveCC.com/

Lazarus v2.2.7-ada7a90186 / FPC v3.2.3-706-gaadb53e72c
(Windows 64-bit install w/Win32 and Linux/Arm cross-compiles via FpcUpDeluxe on both instances)

My Systems: Windows 10/11 Pro x64 (Current)

 

TinyPortal © 2005-2018