★ APPLICATIONS ★ DIVERS ★ RSX PUTKEY (AMSTRAD ACTION) ★![]() |
RSX PutKey (Amstrad Action) | Applications Divers |
RSX of the mouth! This month's entry for your toolbox is a simple command called |PUTKEY. It harnesses a feature of the Amstrad which you can't normally access from BASIC - the ability to pretend that you've pressed a key (you can only use it once before you read a key again, mind you). I found this very useful recently while writing a database. I tested for keys being pressed with INKEY$ (CTRL-S to save, CTRL-L to load, that sort of thing), and if the key was a character between A and Z, the program had to jump straight into the field editing mode, as this was the character to be put in the field. Problem: the A-Z key had already been read, and so the consequent INPUT command wouldn't pick it up. Solution: use this command to pretend the key had been pressed again. The syntax is elementary; if a$ contains the character you want to put back, use |PUTKEY,@a$. Enjoy. By the way, if you've got any toolbox routines, you can send them along to Forum or, if they'd be of value to those learning assembly, you could send them to Assembly Line.
|