473,662 Members | 2,524 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

simple problem...?!

Hi group,

I've got what seems a simple problem, but I can't find the solution. I've
got a textbox and a handheld scanner to scan barcodes, the scanner just
generates keypresses like a keyboard would so if I scan a barcode and the
number from this barcode is 4210, the scanner generates a keypress on the 4
than on the 2 than on 1 and finally on the 0. Now what's my problem, normaly
the barcodes' length always is 16 (so if the length of the textbox.text = 16
I select the entire text so the next barcode can be scanned), but If the
user for example scans the barcode wrong or to fast, only a piece of the
code is generated and my textbox length ain't 16 and the text doesn't get
selected, so if they scan a next barcode this barcode is wrong because it
fills the barcode textbox untill the length is 16 than selects the text and
continues with the remaining numbers. Now this would not be a big problem if
the user had a mouse or a keyboard but they only have got a scanner.

Any help is very welcome

thnx in advance Peter
Nov 21 '05 #1
12 1583
Peter,

I know almost nothing about barcodes.

However every string has a length property what can be tested.

dim a as string = "Hello"
if a.length <> 16 then 'messagebox.sho w("There is something wrong scan
again")

What do I mis in your problem?

Cor
"Peter Proost" <pp*****@nospam .hotmail.com>

I've got what seems a simple problem, but I can't find the solution. I've
got a textbox and a handheld scanner to scan barcodes, the scanner just
generates keypresses like a keyboard would so if I scan a barcode and the
number from this barcode is 4210, the scanner generates a keypress on the
4
than on the 2 than on 1 and finally on the 0. Now what's my problem,
normaly
the barcodes' length always is 16 (so if the length of the textbox.text =
16
I select the entire text so the next barcode can be scanned), but If the
user for example scans the barcode wrong or to fast, only a piece of the
code is generated and my textbox length ain't 16 and the text doesn't get
selected, so if they scan a next barcode this barcode is wrong because it
fills the barcode textbox untill the length is 16 than selects the text
and
continues with the remaining numbers. Now this would not be a big problem
if
the user had a mouse or a keyboard but they only have got a scanner.

Any help is very welcome

thnx in advance Peter

Nov 21 '05 #2
Hi Cor,

I know about the length property, the problem you miss is that the text in
the textbox has to be selected for a new scan to completly overwrite the
text in the textbox, and that's the problem the complete text in the textbox
always has to be selected, I already wrote a piece of code to always select
the entire text in the text box but the problem with that was that it didn't
overwrite the selected text but just added text to it. This would be very
easy if the scanner generated an end of input event or something like that
but it works just like a keyboard and a keyboard also hasn't got a end of
input thingy.

I hope the I was a bit clearer this time :-)

Greetz Peter

"Cor Ligthert" <no************ @planet.nl> wrote in message
news:uj******** ******@TK2MSFTN GP14.phx.gbl...
Peter,

I know almost nothing about barcodes.

However every string has a length property what can be tested.

dim a as string = "Hello"
if a.length <> 16 then 'messagebox.sho w("There is something wrong scan
again")

What do I mis in your problem?

Cor
"Peter Proost" <pp*****@nospam .hotmail.com>

I've got what seems a simple problem, but I can't find the solution. I've got a textbox and a handheld scanner to scan barcodes, the scanner just
generates keypresses like a keyboard would so if I scan a barcode and the number from this barcode is 4210, the scanner generates a keypress on the 4
than on the 2 than on 1 and finally on the 0. Now what's my problem,
normaly
the barcodes' length always is 16 (so if the length of the textbox.text = 16
I select the entire text so the next barcode can be scanned), but If the
user for example scans the barcode wrong or to fast, only a piece of the
code is generated and my textbox length ain't 16 and the text doesn't get selected, so if they scan a next barcode this barcode is wrong because it fills the barcode textbox untill the length is 16 than selects the text
and
continues with the remaining numbers. Now this would not be a big problem if
the user had a mouse or a keyboard but they only have got a scanner.

Any help is very welcome

thnx in advance Peter


Nov 21 '05 #3
Peter,

Can you give a sample something as
Textbox contains 'xxxxxxxxxxxxx
Scanner contains 'xxxxxxxxxxxxxx xx

Result in textbox has to be 'xxxxxxxxxxxxx

Know that a 00 value ends a visiblestring however it still contains it.

Cor
"Peter Proost" <pp*****@nospam .hotmail.com>
Hi Cor,

I know about the length property, the problem you miss is that the text in
the textbox has to be selected for a new scan to completly overwrite the
text in the textbox, and that's the problem the complete text in the
textbox
always has to be selected, I already wrote a piece of code to always
select
the entire text in the text box but the problem with that was that it
didn't
overwrite the selected text but just added text to it. This would be very
easy if the scanner generated an end of input event or something like that
but it works just like a keyboard and a keyboard also hasn't got a end of
input thingy.

I hope the I was a bit clearer this time :-)

Greetz Peter

"Cor Ligthert" <no************ @planet.nl> wrote in message
news:uj******** ******@TK2MSFTN GP14.phx.gbl...
Peter,

I know almost nothing about barcodes.

However every string has a length property what can be tested.

dim a as string = "Hello"
if a.length <> 16 then 'messagebox.sho w("There is something wrong scan
again")

What do I mis in your problem?

Cor
"Peter Proost" <pp*****@nospam .hotmail.com>
>
> I've got what seems a simple problem, but I can't find the solution. I've > got a textbox and a handheld scanner to scan barcodes, the scanner just
> generates keypresses like a keyboard would so if I scan a barcode and the > number from this barcode is 4210, the scanner generates a keypress on the > 4
> than on the 2 than on 1 and finally on the 0. Now what's my problem,
> normaly
> the barcodes' length always is 16 (so if the length of the textbox.text = > 16
> I select the entire text so the next barcode can be scanned), but If
> the
> user for example scans the barcode wrong or to fast, only a piece of
> the
> code is generated and my textbox length ain't 16 and the text doesn't get > selected, so if they scan a next barcode this barcode is wrong because it > fills the barcode textbox untill the length is 16 than selects the text
> and
> continues with the remaining numbers. Now this would not be a big problem > if
> the user had a mouse or a keyboard but they only have got a scanner.
>
> Any help is very welcome
>
> thnx in advance Peter
>
>



Nov 21 '05 #4
Cor,

here's an example:

I scan a barcode of normal length 16 and it returns me:

123456789abcdef h in the textbox and in the text changed event I check to see
if my textbox.text.le ngth is 16 if this is the case I set the selectionstart
and length.

now the next barcode I scan is a wrong one and it returns only 10
characters:

123456789a to the textbox, in my text changed event I check and see that the
length isn't 16 so I don't set the selectionstart and length, but it should
be selected because if I do a new correct scan the text which was in the
textbox has to disapear.

If the scanner would send the entire string at once it wouldn't be a
problem, the textchanged event would do just fine but the scanner doesn't
send what it scans as a complete string, but it sends it like I would type
it in on a keyboard (character per character)

I hope this helps to clear it up

greetz Peter

"Cor Ligthert" <no************ @planet.nl> wrote in message
news:ud******** ******@TK2MSFTN GP11.phx.gbl...
Peter,

Can you give a sample something as
Textbox contains 'xxxxxxxxxxxxx
Scanner contains 'xxxxxxxxxxxxxx xx

Result in textbox has to be 'xxxxxxxxxxxxx

Know that a 00 value ends a visiblestring however it still contains it.

Cor
"Peter Proost" <pp*****@nospam .hotmail.com>
Hi Cor,

I know about the length property, the problem you miss is that the text in the textbox has to be selected for a new scan to completly overwrite the
text in the textbox, and that's the problem the complete text in the
textbox
always has to be selected, I already wrote a piece of code to always
select
the entire text in the text box but the problem with that was that it
didn't
overwrite the selected text but just added text to it. This would be very easy if the scanner generated an end of input event or something like that but it works just like a keyboard and a keyboard also hasn't got a end of input thingy.

I hope the I was a bit clearer this time :-)

Greetz Peter

"Cor Ligthert" <no************ @planet.nl> wrote in message
news:uj******** ******@TK2MSFTN GP14.phx.gbl...
Peter,

I know almost nothing about barcodes.

However every string has a length property what can be tested.

dim a as string = "Hello"
if a.length <> 16 then 'messagebox.sho w("There is something wrong scan
again")

What do I mis in your problem?

Cor
"Peter Proost" <pp*****@nospam .hotmail.com>
>
> I've got what seems a simple problem, but I can't find the solution.

I've
> got a textbox and a handheld scanner to scan barcodes, the scanner just > generates keypresses like a keyboard would so if I scan a barcode and

the
> number from this barcode is 4210, the scanner generates a keypress on

the
> 4
> than on the 2 than on 1 and finally on the 0. Now what's my problem,
> normaly
> the barcodes' length always is 16 (so if the length of the textbox.text
=
> 16
> I select the entire text so the next barcode can be scanned), but If
> the
> user for example scans the barcode wrong or to fast, only a piece of
> the
> code is generated and my textbox length ain't 16 and the text doesn't

get
> selected, so if they scan a next barcode this barcode is wrong
because it
> fills the barcode textbox untill the length is 16 than selects the

text > and
> continues with the remaining numbers. Now this would not be a big

problem
> if
> the user had a mouse or a keyboard but they only have got a scanner.
>
> Any help is very welcome
>
> thnx in advance Peter
>
>



Nov 21 '05 #5
Peter,

Sorry,

It still not is, how you know the scanner is ready.
(I hope you are not just looking for the method textbox.clear")

And just some short answers, more words does not clear it for me. You mis
something and I mis something (I do not see what tells that the barcode
action has ended).

Cor
Nov 21 '05 #6
Hi Cor

That's the problem nothing tells me that the barcode action has ended, it's
just the same as I would type in a 16 digit code in a textbox, there's no
event firing when I stop typing, the scanner just reads the barcode and
sends it to the screen character by character like I would do if I typed it
on my keyboard letter by letter

Peter

"Cor Ligthert" <no************ @planet.nl> wrote in message
news:#m******** ******@TK2MSFTN GP14.phx.gbl...
Peter,

Sorry,

It still not is, how you know the scanner is ready.
(I hope you are not just looking for the method textbox.clear")

And just some short answers, more words does not clear it for me. You mis
something and I mis something (I do not see what tells that the barcode
action has ended).

Cor

Nov 21 '05 #7
Peter,

Do you make the barcodes yourself? Do your barcodes end with any special
characters? Are they all the exact same length?

We print barcodes from our software. We put *'s at the beginning and the
end of the barcode. Then we have just check every time the text is
changed, if the string is larger than 1 and the last character is a *,
we move on to the next field... Just as an example...

Aaron

Peter Proost wrote:
Hi Cor

That's the problem nothing tells me that the barcode action has ended, it's
just the same as I would type in a 16 digit code in a textbox, there's no
event firing when I stop typing, the scanner just reads the barcode and
sends it to the screen character by character like I would do if I typed it
on my keyboard letter by letter

Peter

"Cor Ligthert" <no************ @planet.nl> wrote in message
news:#m******** ******@TK2MSFTN GP14.phx.gbl...
Peter,

Sorry,

It still not is, how you know the scanner is ready.
(I hope you are not just looking for the method textbox.clear")

And just some short answers, more words does not clear it for me. You mis
something and I mis something (I do not see what tells that the barcode
action has ended).

Cor


--
---
Aaron Smith
Remove -1- to E-Mail me. Spam Sucks.
Nov 21 '05 #8
Peter,

However it is scanning, and than doing if it is typing.

So with the first keypress you can set a timer, and than when there are some
milliseconds gone you can test if it is done.

As you wrote it is simple in my opinion. I think that it can be something as
the sample bellow.

However I cannot do the timing that you have to set yourself, because this
what I set is to slow

\\\
Private WithEvents timer1 As New Timer
Private firstkey As Boolean
Private Sub TextBox1_KeyPre ss(ByVal sender As Object, ByVal e _
As System.Windows. Forms.KeyPressE ventArgs) Handles TextBox1.KeyPre ss
If firstkey = False Then
timer1.Enabled = True
timer1.Interval = 1000
End If
End Sub
Private Sub timer1_Tick(ByV al sender As Object, _
ByVal e As System.EventArg s) Handles timer1.Tick
firstkey = False
timer1.Enabled = False
If TextBox1.Text.L ength < 16 Then
MessageBox.Show ("something was wrong")
End If
End Sub
///

I hope this helps?

Cor

"Peter Proost" <pp*****@nospam .hotmail.com>

That's the problem nothing tells me that the barcode action has ended,
it's
just the same as I would type in a 16 digit code in a textbox, there's no
event firing when I stop typing, the scanner just reads the barcode and
sends it to the screen character by character like I would do if I typed
it
on my keyboard letter by letter

Peter

"Cor Ligthert" <no************ @planet.nl> wrote in message
news:#m******** ******@TK2MSFTN GP14.phx.gbl...
Peter,

Sorry,

It still not is, how you know the scanner is ready.
(I hope you are not just looking for the method textbox.clear")

And just some short answers, more words does not clear it for me. You mis
something and I mis something (I do not see what tells that the barcode
action has ended).

Cor


Nov 21 '05 #9
Hi Cor thnx for your time, I've found a solution... and a very easy one, at
first I was told that there wasn't a possibility to connect a mouse to the
terminal on which the programm has to run using citrix, but now I got one in
my hands and a mouse port is available, so problem solved thnx again for
your time and effort and I'll tell the hardware guy at work to look better
in the future thnx again
"Cor Ligthert" <no************ @planet.nl> wrote in message
news:OT******** ******@TK2MSFTN GP09.phx.gbl...
Peter,

However it is scanning, and than doing if it is typing.

So with the first keypress you can set a timer, and than when there are some milliseconds gone you can test if it is done.

As you wrote it is simple in my opinion. I think that it can be something as the sample bellow.

However I cannot do the timing that you have to set yourself, because this
what I set is to slow

\\\
Private WithEvents timer1 As New Timer
Private firstkey As Boolean
Private Sub TextBox1_KeyPre ss(ByVal sender As Object, ByVal e _
As System.Windows. Forms.KeyPressE ventArgs) Handles TextBox1.KeyPre ss
If firstkey = False Then
timer1.Enabled = True
timer1.Interval = 1000
End If
End Sub
Private Sub timer1_Tick(ByV al sender As Object, _
ByVal e As System.EventArg s) Handles timer1.Tick
firstkey = False
timer1.Enabled = False
If TextBox1.Text.L ength < 16 Then
MessageBox.Show ("something was wrong")
End If
End Sub
///

I hope this helps?

Cor

"Peter Proost" <pp*****@nospam .hotmail.com>

That's the problem nothing tells me that the barcode action has ended,
it's
just the same as I would type in a 16 digit code in a textbox, there's no event firing when I stop typing, the scanner just reads the barcode and
sends it to the screen character by character like I would do if I typed
it
on my keyboard letter by letter

Peter

"Cor Ligthert" <no************ @planet.nl> wrote in message
news:#m******** ******@TK2MSFTN GP14.phx.gbl...
Peter,

Sorry,

It still not is, how you know the scanner is ready.
(I hope you are not just looking for the method textbox.clear")

And just some short answers, more words does not clear it for me. You mis something and I mis something (I do not see what tells that the barcode
action has ended).

Cor



Nov 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3685
by: Patchwork | last post by:
Hi Everyone, Please take a look at the following (simple and fun) program: //////////////////////////////////////////////////////////////////////////// ///////////// // Monster Munch, example program #include <list>
6
2142
by: francisco lopez | last post by:
ok , first of all sorry if my english is not so good, I do my best. here is my problem: I don´t know much javascript so I wrote a very simple one to validate a form I have on my webpage. could you please have a look at the following script: ------------------------------------------------------------
0
1880
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I have run into is that the emitted html at the end of the process is slightly different and doesn't work. Please don't be put off by all the source code. All the guts are in this first base class, and it doesn't do much. The rest is trivial...
18
1502
by: Sender | last post by:
Yesterday there was a very long thread on this query. (You can search on this by post by 'sender' with subject 'Simple Problem' post date Oct 7 time 1:43p) And in the end the following code was decided to open a new form: ---Code in the click event of a button: button1 if frm is nothing then frm = new form2() frm.show
27
4608
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res = $doc->loadHTMLFile("./aBasicSearchResult.html"); if ( $res == true ) { $zip = $doc->getElementById('zipRaw_id')->value; if ( 0 != $zip ) {
2
5180
by: Vitali Gontsharuk | last post by:
Hi! I have a problem programming a simple client-server game, which is called pingpong ;-) The final program will first be started as a server (nr. 2) and then as a client. The client then sends the message "Ping" to the server, which reads it and answers with a "Pong". The game is really simple and the coding should be also very simple! But for me it isn't. By the way, the program uses datagram sockets (UDP). And, I'm using
8
3549
by: rdrink | last post by:
I am just getting into pysqlite (with a fair amount of Python and MySQL experience behind me) and have coded a simple test case to try to get the hang of things... yet have run into a 'stock simple' problem... I can create a database 'test.db', add a table 'foo' (which BTW I repeatedly DROP on each run) with one INTGER column 'id', and can insert data into with: cur.execute("INSERT INTO foo (id) VALUES (200)") con.commit()
5
1881
by: Chelong | last post by:
hey,the follow is the text file content ========================================apple====pear== one Lily 7 0 0 7 7 two Lily 20 20 6.6666 20 8 one Lily 0 10 2.85 4 0 two Lily 22 22 7.33326 2 5 two jenny 6 0 0 6 6 two jenny 12 0 0 12 12 three jenny 36 36 10.26 36 36
30
3513
by: galiorenye | last post by:
Hi, Given this code: A** ppA = new A*; A *pA = NULL; for(int i = 0; i < 10; ++i) { pA = ppA; //do something with pA
0
8432
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8546
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7367
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5654
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1993
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.