<p style="padding:0 0 0 0; margin:0 0 0 0;">Looking to docs: https://www.freepascal.org/docs-html/ref/refsu69.html</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">I tried writeln(AnsiString(args[0].VAnsiString));</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">or just writeln(String(args[0].VAnsiString));</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">which works.</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">V. </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">______________________________________________________________<br />
> Od: Darius Blaszyk <dhkblaszyk@zeelandnet.nl><br />
> Komu: FPC-Pascal users discussions <fpc-pascal@lists.freepascal.org><br />
> Datum: 29.10.2017 00:59<br />
> Předmět: [fpc-pascal] Problem with array of const<br />
></p>
Consider the application below. When I run it I do get the following output:<br />
<br />
name<br />
rg��������name�F&{00000000-0000-0000-C000-000000000046}<br />
<br />
In other words I lose the first character (a) from the arguments supplied and the string returns with a lot of garbage. What am I doing wrong here?<br />
<br />
Rgds, Darius<br />
<br />
program test_args;<br />
<br />
procedure test(name: string; args: array of const);<br />
begin<br />
writeln(name);<br />
writeln(args[0].VString^);<br />
end;<br />
<br />
begin<br />
test('name', ['arg']);<br />
end.<br />
<br />
<br />
----------<br />
<br />
_______________________________________________<br />
fpc-pascal maillist - fpc-pascal@lists.freepascal.org<br />
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a>