C++ builder 2007, scan in edit with barcode scanner
Goodmorning
I have a simple application with one edit inside. So the user in this edit use a barcode scanner and scan. I have the above code
if(Key == '\n' ||Key == '\r')
checkCustomer();
So when it scans everything is ok. but when the user put a number from keyboard or letter i want to bring a message to him to use scanner with else.
all the code is on
Edit1KeyDown event
Re: C++ builder 2007, scan in edit with barcode scanner
Quote:
Originally Posted by
Leite333
... I have the above code
But I don't see any code "above"! :confused:
Nor is there some code below! (well, two lines of some pseudo-code that do not make any sense!)
Re: C++ builder 2007, scan in edit with barcode scanner
Goodmorning
Here is some code i wrote. No much things. I want the user to use a scanner barcode and scan on edit. If he use scanner everything is ok. but if he use keyboard copy paste letters on numbers i want to bring a message to use scanner. I wrote the above but its not right. I wrote this code onkeypress event of Edit.. any help?
#
if(Key == '\n' ||Key == '\r') {
MessageDlg("THANK YOU FOR USE SCANNER",mtInformation,TMsgDlgButtons()<<mbOK,0);
else
{
MessageDlg("TRY SCANNER",mtInformation,TMsgDlgButtons()<<mbOK,0);
Edit1->Clear();
Edit1->SetFocus() ;
}
#
Re: C++ builder 2007, scan in edit with barcode scanner
I don't see any "onkeypress" code here, nor is your code properly formatted! :(
Please, read the Announcement... first: http://forums.codeguru.com/announcement.php?f=9
Re: C++ builder 2007, scan in edit with barcode scanner
if(Key == '\n' ||Key == '\r')
MessageDlg("THANK YOU FOR USE SCANNER",mtInformation,TMsgDlgButtons()<<mbOK,0);
else
{
MessageDlg("TRY SCANNER",mtInformation,TMsgDlgButtons()<<mbOK,0);
Edit1->Clear();
Edit1->SetFocus() ;
}
this is my code and its onkeypress event of edit1
you dont need to answer if you dont wanna help
Re: C++ builder 2007, scan in edit with barcode scanner
Well, if you ignore all my requests to clarify your problem then I should give up.
Good luck!
Re: C++ builder 2007, scan in edit with barcode scanner
Quote:
Originally Posted by
Leite333
I wrote the above but its not right.
Would you explain how you know that it's not right? Just what you do and what you get. Did you debug your code? Is the handler really fired?
Besides, you have to inspect the Key value and see what data comes in it. You really sure there must be '\n' or 'r' and not virtual key codes?
And the last but not least. There's no need to be rude with the people that are trying to help. If you see they fail to understand you, you re-phrase, or provide some more detailed description, but keep being nice.