@ptrinc in select case bug

pleiser

Senior Member
When you use @ptrinc in a select case statement I found that the pointer is incremented on each case rather than at the beginning of the select only. for example:
Code:
select case @ptrinc
case 10
case 20
case 30
case 40
endselect
sertxd(#ptr)
the sertxd transmits 4 instead of the expected 1. I can't imagine a scenario where you would want this behavior.
a simple solution is to instead increment the ptr after (or in) the select case statement
however this is inefficient and ugly compared to the above method.

~Patrick

P.S. for those interested I have a new electronics website with details about some of my PICAXE projects at patronics.weebly.com
 

westaust55

Moderator
I am sure the Rev Ed (PICAXE) folks will see your post shortly and advise further.

In the mean time can you clarify whether this is something you have identified
(a) in the Programming Editor (which version?),
(b) the actual PICAXE chip (which chip tested?), or
(c) both of the above?
 

Technical

Technical Support
Staff member
You are correct, as select case is just a convenient way of doing multiple 'if then' comparisons the inc/dec options shouldn't be used in this way. We'll adjust the compiler.
 

papaof2

Senior Member
P.S. for those interested I have a new electronics website with details about some of my PICAXE projects at patronics.weebly.com
That page does not display correctly in Opera for Android. The dropdown items are lost before they can be clicked on because the page refreshes immediately after the dropdown. Remember that "mouseover"doesn't exist in the Android world unless you have a physical mouse connected - everything is done by touch (equivalent to a click in the PC/Mac world).
 

pleiser

Senior Member
I am sure the Rev Ed (PICAXE) folks will see your post shortly and advise further.

In the mean time can you clarify whether this is something you have identified
(a) in the Programming Editor (which version?),
(b) the actual PICAXE chip (which chip tested?), or
(c) both of the above?
I encountered it with a 20X2 and a 28X2
That page does not display correctly in Opera for Android. The dropdown items are lost before they can be clicked on because the page refreshes immediately after the dropdown. Remember that "mouseover"doesn't exist in the Android world unless you have a physical mouse connected - everything is done by touch (equivalent to a click in the PC/Mac world).
thanks for notifying me, I will fix it.
edit: fixed, try now.
 
Last edited:
Top