Help spot the possible bug(?)
Lord Steve
Posts: 206
I just got my first prop plug two days ago so be gentle if this is a head slapper.
For learning purposes I was coding a little text editor.· The project uses the VGA_HiRes_Text object and the Keyboard object and the Propeller Proto board with the VGA/Keyboard/Mouse accessory.
In the attached spin file, I have a case statement that switches on a character read from a keyboard.· When the uses presses the UP ARROW (hex $C2), my little baby text editor's cursor should pop up a line, if it's not on the first line.· But, the cursor jumps way up to before the screen...to negative land.· The debug print-out at the bottom of the screen shows what happens to the variable cursorPos.· I have stared at the spin code and can't see anything wrong with it...it just subtracts 128 from cursorPos.
Check out the $C2 case statement (line 55) in the PutChar method.
If anyone wants to take a stab at humilitating me with how dumb it is that I can't see the problem...please do.
For learning purposes I was coding a little text editor.· The project uses the VGA_HiRes_Text object and the Keyboard object and the Propeller Proto board with the VGA/Keyboard/Mouse accessory.
In the attached spin file, I have a case statement that switches on a character read from a keyboard.· When the uses presses the UP ARROW (hex $C2), my little baby text editor's cursor should pop up a line, if it's not on the first line.· But, the cursor jumps way up to before the screen...to negative land.· The debug print-out at the bottom of the screen shows what happens to the variable cursorPos.· I have stared at the spin code and can't see anything wrong with it...it just subtracts 128 from cursorPos.
Check out the $C2 case statement (line 55) in the PutChar method.
If anyone wants to take a stab at humilitating me with how dumb it is that I can't see the problem...please do.
Comments
BTW, you aren't stupid or dumb, I would have made the same mistake. Its kind of weird that they deviated from other standard languages so much with the Spin language constructs, but what are ya gonna do?