Computer Science Canada Backspacing in my (text editor?) |
| Author: | MagicIdiot [ Tue Jun 22, 2010 8:11 am ] | ||
| Post subject: | Backspacing in my (text editor?) | ||
What is it you are trying to achieve? Well grade 11 is over and I'll be quite bored over the summer. So i decided to make a program to test how fast you can type. What is the problem you are having? When you have multiple rows of text, trying to go back to a previous row with backspace is my problem. I can't seem to get the x coordinate right. The way I'm determining x right now only works if I have a max of 2 rows of text. I need a new method to get x. Describe what you have tried to solve this problem Change the way i get X. The only way I can think of is to have an array that holds the width(px) on each row. But I don't know how many rows there will be. It can be a waste of space. But if thats the only way.. Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Please specify what version of Turing you are using 4.1 |
|||
| Author: | copthesaint [ Tue Jun 22, 2010 9:19 am ] |
| Post subject: | RE:Backspacing in my (text editor?) |
I belive BackSpace is chr (7). Try that, if it doesnt work, try 8,9,10. Those couple are space enter and backspace however I forget the order. |
|
| Author: | DemonWasp [ Tue Jun 22, 2010 9:49 am ] |
| Post subject: | RE:Backspacing in my (text editor?) |
If seems like you want a flexible array. That kind of array lets you resize it at runtime as needed with the new keyword. Alternately, look for "collections" under the Turing Submissions section and you'll find a few implementations of Lists, which are what you actually want. |
|
| Author: | MagicIdiot [ Tue Jun 22, 2010 11:07 am ] |
| Post subject: | Re: Backspacing in my (text editor?) |
The flexible array seems to work. I didn't know about it. Thanks. |
|