Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help for a friend
#1
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][Image: safer.gif][/url]
Reply
#2
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)
Reply
#3
that will help hime alot thanx
url=http://www.spreadfirefox.com/?q=affiliates&id=0&t=79][Image: safer.gif][/url]
Reply
#4
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
Reply
#5
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.
*****
Reply
#6
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.
Reply
#7
But Plasma's code handles two byte ASCII codes. You see the 'elseif'??? There you go
B 4 EVER
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)