On 07/03/2018 12:01 PM, Tomas Hajny wrote:
On Tue, July 3, 2018 17:15, Ryan Joseph wrote:
Why is that so crazy slow? Does it need to iterate the entire length of the
string to know it’s length? >
Yes, that's indeed the difference between Pascal strings (Short/Ansi/Wide/UnicodeString) and C-like PChars.

absolutely! i truly hated having to add loops to my string handling code when working with ""C strings"" as we used to call them back in the day... the huge advantage of "Pascal strings" is their length being specified at the beginning of the character array they are stored in...

i think i'm still waiting for the string "length byte" becoming a "length word" or possibly a "length long" so the speed of pascal strings can be reacquired -=B-)



--
 NOTE: No off-list assistance is given without prior approval.
       *Please keep mailing list traffic on the list unless*
       *a signed and pre-paid contract is in effect with us.*
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to