<div dir="ltr">However, since you are using Delphi 6 the StrPCopy code should be yielding the same thing as that constant declaration.<br><br><span style="font-size:12.8000001907349px"><br>I&#39;ve also just noticed that your call to the API passes bufferr directly.  I am surprised this even compiles with the declaration for the API function as provided in the code.  This indicates that a pointer to a buffer is required, but you are passing the buffer itself:<br><br>   receive:=API_PCDRead(0,0,$00,</span><span style="font-size:12.8000001907349px">10,1,key,bufferr);<br></span><br><span style="font-size:12.8000001907349px">vs (I would expect):</span><div><span style="font-size:12.8000001907349px"><br></span><div><span style="font-size:12.8000001907349px">   receive:=API_PCDRead(0,0,$00,</span><span style="font-size:12.8000001907349px">10,1,key,@bufferr[0]);</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><br></div><div>Do you have a reference to the documentation for the API you are using ?  That will tell us what the API is expecting which might in turn point to the problem in the code.  Without that we are pretty much shooting in the dark.<br><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 28 May 2015 at 12:06, Jolyon Smith <span dir="ltr">&lt;<a href="mailto:jsmith@deltics.co.nz" target="_blank">jsmith@deltics.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"><div dir="ltr">Sorry, a typo in that.  As a typed constant it should have read:<span class=""><br><br><span style="color:rgb(80,0,80);font-size:12.8000001907349px">   const</span><br style="color:rgb(80,0,80);font-size:12.8000001907349px"><span style="color:rgb(80,0,80);font-size:12.8000001907349px">     KEY : array[0..6] of Byte = ($FF,$FF,$FF,$FF,$FF,$FF,$00);<br></span><br></span>Note the first &#39;=&#39; is now a &#39;:&#39;<div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 28 May 2015 at 11:33, 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><br>
   const<br>
     KEY = array[0..6] of Byte = ($FF,$FF,$FF,$FF,$FF,$FF,$00);<br>
<br>
</span>Thanks Wallace.<br>
<div><div><br>
<br>
_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@listserver.123.net.nz" target="_blank">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" target="_blank">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>