Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Jun 06, 2020 12:29 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: EditField control & barcode scanner
PostPosted: Fri Dec 30, 2005 11:09 am 
Offline

Joined: Wed Dec 21, 2005 12:04 pm
Posts: 110
I found this weird problem when I using barcode scanner .
the barcode scanner I using with connector to keyboard (not com port).
usually once scan the scanner will return the barcode no + Enter (13) .
i test this on rb ide (no problem) the problem come when use on my program editfield .
on editfield keydown event
if asc(key) = 13 then
' process the key
end

but somehow editfield capture the enter signal from the scanner before the number.
example:
912345678enter (correct way)
9enter12345678 (wrong way)

any alt way to resolve this?



:(


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Dec 30, 2005 12:28 pm 
Offline

Joined: Sat Oct 01, 2005 9:55 am
Posts: 527
Throw out the Enter key, and have the barcode process when it reaches the proper length (presuming the barcode system you're using is fixed-length).


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Dec 30, 2005 9:25 pm 
Offline

Joined: Wed Dec 21, 2005 12:04 pm
Posts: 110
the problem it may not in fixed length. but how come it has such problem? . I don't see it give such problem when I try iton rb IDE?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Dec 31, 2005 2:23 am 
Offline
User avatar

Joined: Fri Sep 30, 2005 3:53 pm
Posts: 3261
Location: England
Just trying to work out what's going on here.

1) What happens if you just use a multiline editfield with no KeyDown handler?
If you scan 2 barcodes, do you get a new line at the end of the first barcode or part way through it?

2) In your code, what does ' process the key actually do?

3) Does it work if you put on a form a StaticText and an EditField with this KeyDown event
Function KeyDown(Key As String) As Boolean
Select Case Asc(Key)
Case 13
StaticText1.Text = me.Text
me.Text = ""
Case 32 to 122
me.AppendText key
End Select
Return True
End Function


4) If this doen't track down your problem, the next step is probably to build a canvas subclass with a memoryblock as a barcode receiver.

_________________
Steve Garman
Using REALbasic 2008r2 Professional on Windows Vista Ultimate
and REALbasic 2009r5.1 Professional on Linux Ubuntu 9.04 Desktop
and REAL Studio 2010r1 Personal on Linux Ubuntu 9.10 Desktop
Occasional blog


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Dec 31, 2005 12:47 pm 
Offline

Joined: Wed Dec 21, 2005 12:04 pm
Posts: 110
let me make this clear.
- I not scaning 2 barcode but only one.
- usually scanner send number of the scan barcode plus enter char(13) to indicate end of scan
- somehow rb editfields catch enter(char(13)) first before finish catching all number . so it endup rather than 9123456789 + enter(char(13) it become 9enter(char13)123456789 .
- i test scanning on rb code editor and found no problem (it show)
923456789 +enter (char13) . I know because the cursor move to second line not like this :
9
123456789


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Dec 31, 2005 1:12 pm 
Offline
User avatar

Joined: Fri Sep 30, 2005 3:53 pm
Posts: 3261
Location: England
Ok. I'll stop interfering

_________________
Steve Garman
Using REALbasic 2008r2 Professional on Windows Vista Ultimate
and REALbasic 2009r5.1 Professional on Linux Ubuntu 9.04 Desktop
and REAL Studio 2010r1 Personal on Linux Ubuntu 9.10 Desktop
Occasional blog


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group