Re: [fpc-pascal] Declaring an array as var or not in function calls?

2023-04-13 Thread Sven Barth via fpc-pascal
Bo Berglund via fpc-pascal schrieb am Do., 13. Apr. 2023, 07:49: > What is the use case for "out" compared to "var" when it seemingly is > doing the > same thing? > Or is it exactly this: > With "out" you get a pristine empty variable which you have to initialize > if > needed (setting its

Re: [fpc-pascal] Declaring an array as var or not in function calls?

2023-04-12 Thread Bo Berglund via fpc-pascal
On Thu, 13 Apr 2023 00:06:16 +0200, Sven Barth via fpc-pascal wrote: >Bo Berglund via fpc-pascal schrieb am >Mi., 12. Apr. 2023, 21:17: > >> Now my question: >> >> Since I am modifying the WArgs variable inside the BuildArgumentsArray >> function and using its new content

Re: [fpc-pascal] Declaring an array as var or not in function calls?

2023-04-12 Thread Sven Barth via fpc-pascal
Bo Berglund via fpc-pascal schrieb am Mi., 12. Apr. 2023, 21:17: > Now my question: > > Since I am modifying the WArgs variable inside the BuildArgumentsArray > function > and using its new content afterwards in the WriteItem function I assumed > that I > had to use var as shown

Re: [fpc-pascal] Declaring an array as var or not in function calls?

2023-04-12 Thread Sven Barth via fpc-pascal
Giuliano Colla via fpc-pascal schrieb am Mi., 12. Apr. 2023, 22:54: > Il 12/04/2023 21:17, Bo Berglund via fpc-pascal ha scritto: > > And if so, what is the rule for **when** to use var in function call argument > lists for items that will be changed inside the called function and used >

Re: [fpc-pascal] Declaring an array as var or not in function calls?

2023-04-12 Thread Giuliano Colla via fpc-pascal
Il 12/04/2023 21:17, Bo Berglund via fpc-pascal ha scritto: And if so, what is the rule for*when* to use var in function call argument lists for items that will be changed inside the called function and used afterwards? Your Wargs is defined as an open array, i.e. its length is unknown at