- Creating a string from keypresses
- 28 Nov 2018 03:14:07 pm
- Last edited by johnbchron on 28 Nov 2018 03:46:46 pm; edited 1 time in total
So I have been having some issues with using the keys to create strings in ICE. I am posting snippets of my code because this project is a suprise/secret and/or I make no guarantees about it existing later (ram clears are the bane of my existence).
My thought is to have 56 bytes allocated for key reference (default value is 0), in which the template is:
ASCII Value --> *{ICE Key Value}
I will then have have a loop that checks whether or not there is any information in that byte, and if so, whether or not the key is being pressed. Then it shows that character.
Again, sorry this has to be in snippets.
Code:
And in another place:
Code:
The difficulty is that this either has some error that I am just not seeing or this method is wildly inconsistent, because, even though there is usually a key that will trigger this, it is never what it is supposed to be.
Can anyone help? All is appreciated.
EDIT: never mind
Sax + PT + c4ooo solved my problems
My thought is to have 56 bytes allocated for key reference (default value is 0), in which the template is:
ASCII Value --> *{ICE Key Value}
I will then have have a loop that checks whether or not there is any information in that byte, and if so, whether or not the key is being pressed. Then it shows that character.
Again, sorry this has to be in snippets.
Code:
Alloc(56)->KEYS
65->*{KEYS+47}
And in another place:
Code:
For(I,0,55)
If (*{KEYS+I}!=0)
*{KEYS+I}->CHAR
I->KEY
If getKey(KEY)
SetTextXY(5,220)
PrintChar(CHAR)
End
End
End
The difficulty is that this either has some error that I am just not seeing or this method is wildly inconsistent, because, even though there is usually a key that will trigger this, it is never what it is supposed to be.
Can anyone help? All is appreciated.
EDIT: never mind
Sax + PT + c4ooo solved my problems