<div dir="ltr"><div><span style="font-size:12.8000001907349px">I don&#39;t know the API_PCDRead function. But there looks to be an error in your code even if it works. You are passing bufferr (two &#39;r&#39;s) to the function but referring to buffer (one &#39;r&#39;) afterwards, which wasn&#39;t used (unless there&#39;s other code you didn&#39;t show). So you need to look at that.</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">That aside, for the bit leading up to the call, try something like:</span></div><div><br></div><div><span style="font-size:12.8000001907349px">var</span></div><div><span style="font-size:12.8000001907349px">  key, bufferr: PChar;</span></div><div><span style="font-size:12.8000001907349px">  keydata: string;</span></div><div><span style="font-size:12.8000001907349px">  buffdata: array[0..255] of char;</span></div><div><span style="font-size:12.8000001907349px">  ...</span></div><div><span style="font-size:12.8000001907349px">begin</span></div><div><span style="font-size:12.8000001907349px"> // Allocate a string of six consecutive $FFs</span><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">  keydata := #255#255#255#255#255#255;</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"> // Convert to a PChar, an easy way to avoid having to allocate memory explicitly</span><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">  key := PChar(keydata);</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">// </span><span style="font-size:12.8000001907349px">Once again avoid having to allocate memory explicitly</span></div><div><span style="font-size:12.8000001907349px">// Point bufferr at the </span><span style="font-size:12.8000001907349px">address of an </span><span style="font-size:12.8000001907349px">array of </span><span style="font-size:12.8000001907349px">256 characters</span></div><div><span style="font-size:12.8000001907349px">  bufferr := PChar(@buffdata); </span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">  receive:=API_PCDRead(0,0,$00,</span><span style="font-size:12.8000001907349px">10,1,key,bufferr);</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">  ...</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Cheers,</span></div><div><span style="font-size:12.8000001907349px">Carl</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 28, 2015 at 11:33 AM, Marshland Engineering <span dir="ltr">&lt;<a href="mailto:marshland@marshland.co.nz" target="_blank">marshland@marshland.co.nz</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks for the replies.<br>
<br>
this is the line<br>
<br>
&gt;   receive:=API_PCDRead(0,0,$00,10,1,key,bufferr);<br>
<br>
I&#39;m way out my depth with the workings of this function. I just do simple<br>
coding - A ex dBase3 programmer.<br>
<br>
I took the sample code that the RFID supplier gave, stripped off everything I<br>
didn&#39;t need other than the read line for RFID card and then copied the bits<br>
into my program which now crashes.<br>
<br>
I was wondering if the XPMENU call or something like that is interfering with<br>
other modules ?<br>
<br>
My debugging is limited to finding the line with the error.<br>
<br>
Both programs are run in Delphi 6, same machine and same environment.<br>
<br>
I can&#39;t find how to code this, where ever I put it, it crashes. - Expected<br>
expression but ARRAY found.<br>
<span class=""><br>
   const<br>
     KEY = array[0..6] of Byte = ($FF,$FF,$FF,$FF,$FF,$FF,$00);<br>
<br>
</span>Thanks Wallace.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<br>
</div></div></blockquote></div><br></div>