Posts: 538
Threads: 62
Joined: Apr 2003
my friend dosen't have the internet and wants to know
what the ascii character codes for ALT+s is and ALT+Q
thanx
url=http://www.spreadfirefox.com/?q=affiliates&id=0&t=79]
[/url]
Posts: 1,752
Threads: 21
Joined: Jun 2002
Alt-S is CHR$(0) + CHR$(31)
Alt-Q is CHR$(0) + CHR$(16)
You can write a simple program to find out other ones as well...
Code:
CLS
DO
k$ = INKEY$
IF LEN(k$) = 1 THEN
CLS
LOCATE 1, 1
PRINT k$ + " ";
LOCATE 2, 1
PRINT "CHR$(" + LTRIM$(STR$(ASC(k$))) + ")";
ELSEIF LEN(k$) = 2 THEN
CLS
LOCATE 1, 1
PRINT k$;
LOCATE 2, 1
PRINT "CHR$(" + LTRIM$(STR$(ASC(k$))) + ") + CHR$("+ LTRIM$(STR$(ASC(RIGHT$(k$, 1)))) + ")";
END IF
LOOP WHILE k$ <> CHR$(27)
Posts: 538
Threads: 62
Joined: Apr 2003
that will help hime alot thanx
url=http://www.spreadfirefox.com/?q=affiliates&id=0&t=79]
[/url]
Posts: 1,407
Threads: 117
Joined: Dec 2002
Ascii Alt-Q and ascii Alt-S do not exist.
What Plasma357 put in his answer are the INKEY$ function return codes.And that's not the same than the keyboard sacan codes, that would be different. But nothing is defined in ASCII for Alt-Q and Alt-S.
Antoni
Posts: 1,956
Threads: 65
Joined: Jun 2003
Right, Antoni, a very important point.
Said another way, QB can identify Alt-Q and Alt-S combination keys via the QB INKEY$ function. But these combination keys are NOT part of the Ascii character set, and INKEY$ has to identify these by using 2 bytes, where for a real Ascii character it only needs to use 1 byte.
As a matter of fact, if I'm not mistaken, none of the combinations with ALT are represented in Ascii code. This means that if you wanted to save the Alt-anykey combination anywhere on a file, for example, you would have to use a two byte scheme to do this, which could get very tedious.
*****
Posts: 3,368
Threads: 195
Joined: Jan 2003
It only gets tedious if you have to remake the function for each program... unless you use modules/libs....
One of my current programs supports two-character combos...... I'm using INP(96) for now... but it is a pain.......
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 594
Threads: 11
Joined: Oct 2002
But Plasma's code handles two byte ASCII codes. You see the 'elseif'??? There you go
B 4 EVER