<div dir="auto">Ok, I'll check it out. Thanks guys, did not realize it was a pointer, too many years writing scripts instead of code. Thanks!!</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 6, 2022, 11:51 PM Michael Van Canneyt <<a href="mailto:michael@freepascal.org">michael@freepascal.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On Thu, 6 Jan 2022, Ozz Nixon via fpc-devel wrote:<br>
<br>
> Procedure Make_Language_File(<br>
> Description,MenuPath,TextPath,QuestPath:String;<br>
> Enabled:Boolean;SecurityLevel:Byte;Flags:Longint);<br>
> Var<br>
> FileSize:Longint;<br>
><br>
> Begin<br>
> Writeln('Language_File empty size is ',SizeOf(L));<br>
> FileSize:=0;<br>
> Description:=Description+#0;<br>
> Inc(FileSize,Length(Description));<br>
> MenuPath:=MenuPath+#0;<br>
> Inc(FileSize,Length(MenuPath));<br>
> TextPath:=TextPath+#0;<br>
> Inc(FileSize,Length(TextPath));<br>
> QuestPath:=QuestPath+#0;<br>
> Inc(FileSize,Length(QuestPath));<br>
> SetLength(L.Description,Length(Description));<br>
> SetLength(L.MenuPath,Length(MenuPath));<br>
> SetLength(L.TextPath,Length(TextPath));<br>
> SetLength(L.QuestPath,Length(QuestPath));<br>
> Move(Description[1],L.Description,Length(Description));<br>
<br>
This code is wrong. That must be<br>
<br>
Move(Description[1],L.Description[0],Length(Description));<br>
<br>
> Move(MenuPath[1],L.MenuPath,Length(MenuPath));<br>
<br>
Same here.<br>
Move(MenuPath[1],L.MenuPath[0],Length(MenuPath));<br>
<br>
> Move(TextPath[1],L.TextPath,Length(TextPath));<br>
<br>
Same here<br>
Move(TextPath[1],L.TextPath[0],Length(TextPath));<br>
<br>
> Move(QuestPath[1],L.QuestPath,Length(QuestPath));<br>
<br>
Same here.<br>
Move(QuestPath[1],L.QuestPath[0],Length(QuestPath));<br>
<br>
These fields are dynamic arrays, in essence pointers to a memory block.<br>
<br>
Your code writes to the memory area for pointer, not to the memory area the pointer points to.<br>
<br>
Michael.<br>
</blockquote></div>