Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
AtomR
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Portugal
Posted: 6th Aug 2003 13:39
Shouldn't this command return the text value of an ascii code?
Like chr$(16)="Q" but instead it prints a square in my screen

What am I doing wrong? Which command should I use to turn the ascii code 16 into the letter Q?
Take care
AtomR
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 6th Aug 2003 13:56
chr$(16) is NOT the letter "Q".
try this (It will tell you the real value for "q"):
do
in$=str$(asc(inkey$))
text 10,10,in$
loop

I need an animator!!! HELP ME!!
AtomR
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Portugal
Posted: 6th Aug 2003 22:27 Edited at: 6th Aug 2003 22:35
Hmmmmm you're right!!!!!

Then how can the Scancode() command detect the 'Q' key as 16??
Doesn't scancode work with ascii values?
I've been programming basic for years and thought I had put this part of basic programing behind me years ago but I'm getting rather confused here

I've been experencing some annoying problems with my computer.
For one my Ad-watcher detects that a program is trying to alter my registry every 30 seconds. Winamp continues playing its playlist even after I close it. Then, whenever I Ctrl+Alt+Del, my Task manager closes before I can even get there with my mouse pointer. But Norton doesn't detect any viruses with it's most recent virus defenitions.
Can whatever is causing my problems be altering ASCII codes ort whatever?

Take care
AtomR
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 6th Aug 2003 22:41
I don't think so. The values returned by scancode are not ascii.
Try running regedit and see if anything that shouldn't be is in the run folder. Maby that way you'll find out what's going on in your PC.

I need an animator!!! HELP ME!!
Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 6th Aug 2003 22:45
try the free virus scanner at www.grisoft.com . the problem with norton is alot of viruses target it because it's one of the most popular. could not be a virus, but it's worth a try, this is a great virus scanner and its free

Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 6th Aug 2003 22:46
oh and start/run msconfig.exe (if u have an OS that includes it) might show you something suspicous.

AtomR
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Portugal
Posted: 6th Aug 2003 23:03
Norton updated today its virus defenitions and after instaling it Norton detects W32.Spybot.worm. So thats maybe it. I don't know. Norton can't remove.

Take care
AtomR
AtomR
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Portugal
Posted: 6th Aug 2003 23:27
Quote: "
I don't think so. The values returned by scancode are not ascii.
"

It doesn't differentiate between caps on and off so the codes returned by scancode were made to more easilly help the game maker.
Thanks for your help.

Take care
AtomR
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 6th Aug 2003 23:32
Scancode returns the code for the actual key that is pressed - regardless of the character on it.

I use a Spanish keyboard and if you use the Scancode value for the + key on a US or British keyboard in your program and say that the key to press is the + key, it wouldn't work on my keyboard as the + is on a different key.

The ASCII value however would work on all systems as only the + key would generate the ASCII value for + regardless of the key it was on.

The main benefits of Scancode is that it can be used with KeyState to detect when more than one key is pressed at the same time.

TDK

Login to post a reply

Server time is: 2025-05-20 01:40:45
Your offset time is: 2025-05-20 01:40:45