Yes guys, thank you very much!
Of course I know what the stack is for
The question is a little different.
Here's an example:
___________
|Text |
|__________|
Then the user quickly presses keys 1,2,3
___________
|Text123 |
|__________|
What should be on the stack?
1) ----------
Text
Text123
or
2)----------
Text
Text1
Text12
Text123
Thanks
Isn't there a difference between using the [<-] backspace key and going ctrl-Z for Undo?
If you have just pressed keys 123 quickly and not pressed Enter, you can press [<-][<-] key and type 132 as you intended. I assume that is built into Windows and every other version of a Textbox or other standard controls.
If you have already pressed Enter, the box now contains"Text123" and need to amend, that is where ctrl-Z might be useful and no it would not backspace by one Char, but perhaps revert to a previous state. That could be revert the contents to "Text" or perhaps to put the cursor back in the edit box.
BUT surely Undo can not be a method of the TEdit but of the whole form. Because once you have left the form by pressing Enter, it is the Form that has focus and receives the ctrl-Z keypress. So the stack would need to contain which control was last used to make changes as well as what the changes were.
of course I may be wrong.