[fpc-pascal] Size of set.

2023-05-22 Thread Mikael Backman via fpc-pascal
Hi, basic questions here. Is there any way to decide the number of elements in a set? there any way to traverse the elements in a set? Regards Mikael ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mail

Re: [fpc-pascal] Freeing memory with exceptions

2023-05-22 Thread Michael Van Canneyt via fpc-pascal
On Mon, 22 May 2023, Benito van der Zander via fpc-pascal wrote: Hi, The compiler will do this wrapping anyway if you use ansistrings, so the approach with e.g. a generic record will not cause a lot of overhead in most cases. But using strings or anything similar causes a lot of overhe

Re: [fpc-pascal] Freeing memory with exceptions

2023-05-22 Thread Benito van der Zander via fpc-pascal
Hi, The compiler will do this wrapping anyway if you use ansistrings, so the approach with e.g. a generic record will not cause a lot of overhead in most cases. But using strings or anything similar causes a lot of overhead It is really bad Bye, Benito On 21.05.23 18:03, Michael Van Can

Re: [fpc-pascal] Freeing memory with exceptions

2023-05-22 Thread Michael Van Canneyt via fpc-pascal
On Mon, 22 May 2023, Steve Litt via fpc-pascal wrote: Michael Van Canneyt via fpc-pascal said on Sun, 21 May 2023 09:47:15 +0200 (CEST) On Sun, 21 May 2023, Hairy Pixels via fpc-pascal wrote: I've never really used exceptions myself in Pascal (with the exception of breaking out of deeply

Re: [fpc-pascal] Freeing memory with exceptions

2023-05-22 Thread Steve Litt via fpc-pascal
Michael Van Canneyt via fpc-pascal said on Sun, 21 May 2023 09:47:15 +0200 (CEST) >Assuming the result of A is not used outside of Test, the following is >the only solution: > >procedure Test; > >var > A : TObject; >begin > A:=TObject.Create; > Try > // call some code in other unit which

Re: [fpc-pascal] Freeing memory with exceptions

2023-05-22 Thread Steve Litt via fpc-pascal
Michael Van Canneyt via fpc-pascal said on Sun, 21 May 2023 09:47:15 +0200 (CEST) >On Sun, 21 May 2023, Hairy Pixels via fpc-pascal wrote: > >> I've never really used exceptions myself in Pascal (with the >> exception of breaking out of deeply recursive function calls) so I >> don't know all the r