@ptrinc destination variable error

Ianj

New Member
Greetings All

I upgraded PE6 from 6.0.6.1 to 6.0.8.8 today and loaded a previously known good project.

When I ran the syntax check it failed and came up the following error message


bcdtoascii TC_Temp_Data, @ptrinc, @ptrinc

Syntax error on line 379 at/before position 43

Error: @ptrinc cannot be used as for variable!


Prior to the line of code bcdtoascii TC_Temp_Data, @ptrinc, @ptrinc I've set the ptr to a correct value. I use variations of this line of code in multiple places and it fails in all of them

Has something changed in the picaxe system between the versions of PE6? As I said earlier as far as I'm concerned this was working code

I don't have a copy of the old version of PE6 to check and see if the error goes away.

I did a web search on that error code but only came with post from 2007

http://www.picaxeforum.co.uk/showthread.php?7109-ptrinc-cannot-be-a-destination-variable

I don't think the solution suggested applies now

Any suggestions?

Regards

Ian J
 

Technical

Technical Support
Staff member
bcdtoascii is a 'pseudo' command that actually compiles as a sequence of other native commands. Due to this, use of @ptrinc within this command can lead to unexpected/unreliable results when the native commands process in their sequence, therefore the compiler no longer allows this use. It may have appeared to work before, but would not be reliable with some values. So please use a regular bX variable instead.
 

Ianj

New Member
Thanks for the quick reply.

Pity about that, I haven't experienced any problem with it but it looks like I'll be doing a rewrite in the near future

Regards

Ian J
 
Top