Re: [fpc-pascal] Passing around Pascal strings vs AnsiString

2023-06-15 Thread Peter B via fpc-pascal
On 14/06/2023 14:20, Hairy Pixels via fpc-pascal wrote: I was curious, if you had a Pascal (short) string and it was going to be passed around often would that be slower than using an AnsiString since its size is that of a pointer? I always prefer short strings when I know the length will be l

Re: [fpc-pascal] Passing around Pascal strings vs AnsiString

2023-06-14 Thread Hairy Pixels via fpc-pascal
> On Jun 14, 2023, at 8:30 PM, Michael Van Canneyt via fpc-pascal > wrote: > > For parameters that are passed by value, the copying most likely will be > slower since all bytes from the string must be copied to the new string. > > For var parameters it should not matter. ah yes var. What ab

Re: [fpc-pascal] Passing around Pascal strings vs AnsiString

2023-06-14 Thread Michael Van Canneyt via fpc-pascal
On Wed, 14 Jun 2023, Hairy Pixels via fpc-pascal wrote: I was curious, if you had a Pascal (short) string and it was going to be passed around often would that be slower than using an AnsiString since its size is that of a pointer? I always prefer short strings when I know the length will be

[fpc-pascal] Passing around Pascal strings vs AnsiString

2023-06-14 Thread Hairy Pixels via fpc-pascal
I was curious, if you had a Pascal (short) string and it was going to be passed around often would that be slower than using an AnsiString since its size is that of a pointer? I always prefer short strings when I know the length will be less than 255 but can copying that value between function c