Re: [fpc-pascal] Problem with array of const

2017-10-29 Thread Tony Whyman
I've fallen into various traps with array of const before. I would always recommend that: 1. Test the vType before accessing the argument value and raise an exception if it is not what is expected. You are dealing with a free union and the compiler may not always do what you expect it to. 2.

Re: [fpc-pascal] Problem with array of const

2017-10-28 Thread pascalX
On 29/10/17 00:31, Vojtěch Čihák wrote: Looking to docs: https://www.freepascal.org/docs-html/ref/refsu69.html I tried writeln(AnsiString(args[0].VAnsiString)); or just writeln(String(args[0].VAnsiString)); which works. V. __ > Od:

Re: [fpc-pascal] Problem with array of const

2017-10-28 Thread pascalX
On 29/10/17 00:31, Vojtěch Čihák wrote: Looking to docs: https://www.freepascal.org/docs-html/ref/refsu69.html I tried writeln(AnsiString(args[0].VAnsiString)); or just writeln(String(args[0].VAnsiString)); which works. V. __ > Od:

Re: [fpc-pascal] Problem with array of const

2017-10-28 Thread Vojtěch Čihák
Looking to docs: https://www.freepascal.org/docs-html/ref/refsu69.html I tried writeln(AnsiString(args[0].VAnsiString)); or just writeln(String(args[0].VAnsiString)); which works.   V.  __ Od: Darius Blaszyk Komu: FPC-Pascal users discu