For Programmers: Free Programming Magazines  


Home > Archive > Clarion > April 2005 > ACCEPT loop bug found in Clarion using Keyboard Bar Code Scaner - help !!









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author ACCEPT loop bug found in Clarion using Keyboard Bar Code Scaner - help !!
Framp

2005-04-23, 3:55 am

I have found a bug (I think) in the standard ACCEPT loop used in a million
Clarion
Programs. Here is my code:

PROGRAM
MAP
END
MyCode SHORT
MyWin Window('Hello'),System
END
CODE
Open(MyWin)
ALERT()
ALERT(65,66) ! Alert 'A','B' KEY CODES
ALERT(51) ! Alert ASCII '3' KEY CODE
ACCEPT
case EVENT()
OF EVENT:AlertKey
if (KeyCode() = 65) then
MyCode = 65
end
if (KeyCode() = 51) then
MyCode=51
end
ELSE
END
END

Excuse the stupid assignment of MyCode, but I do this so i can
trace the flow in the Debugger.

I start the program and give it Windows Focus. My scanner is connected to
the
KB port thru a y-connector joining the KB and Scanner. If I shoot a bar code
that has 'A33333' on it, all I get is the 33333's and not the leading 'A'.
When I launch
any other Windows program that takes KB input , give it focus and scan the
same Bar Code,
I get the leading 'A' and trailing 33333's. I looked at this with the
dubugger and the first
EVENT I get with the Clarion code above is the initial '3', never the
expected 'A'.
If I move the the attached keyboard and strike an 'A' or 'B', it works OK.
Only
when using the scanner does it not work.

Anyone have this or a similar problem ? The scanner is programmed correctly
because I can use it with all other non-Clarion (including DOS console apps)
programs with success.

thanks


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com