Re: [fpc-pascal] dereferenced pointer as open array argument

2015-09-21 Thread Jonas Maebe
Seth Grover wrote on Fri, 18 Sep 2015: procedure ArrayTest(const data : array of char); ... However, it surprised me that this syntax was accepted (with a dereferenced pchar): ArrayTest(myPChar^); as well as this syntax (with a simple char): ArrayTest(myChar); In both of those cases, Arra

[fpc-pascal] dereferenced pointer as open array argument

2015-09-18 Thread Seth Grover
Imagine I have this function: procedure ArrayTest(const data : array of char); begin ... end; and in another routine I have a pchar variable. If I slice the array byte doing this: ArrayTest(myPChar[0..99]); then inside ArrayTest it will appear that data is 100 characters, which is exactly wha