Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is CHRSAW() for?
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Divers
Thread ID:
01523252
Message ID:
01523298
Vues:
62
I forgot one line of code:
In the InteractiveChange event of the textbox, you must first disable the timer so it starts counting again, that is more secure.

THISFORM.Timer.Enabled = .F.
THISFORM.Timer.Enabled = .T.


>What I would do:
>
>Add a timer control, with Interval 30 and Enabled = .F.
>In the EVENT method of the timer write
>
>THIS.Enabled = .F.
>KEYBOARD CHR(13)
>
>In the interactive change of the textbox, enable the timer:
>
>THISFORM.Timer.Enabled = .T.
>
>In The LostFocus event of the textbox write
>
>THISFORM.Timer.Enabled = .F.
>
>The idea is that the scanner writes the characters very fast to the textbox. Once the scanner is ready sending keys to the textbox, the timer will send the ENTER key to the textbox.
>
>This solution will not work if you can enter the numbers manually, although there is a way to moitor they keyboard behaviour and you can figure out if someone is typing the characters or the scanner is sending them.
>
>>Hi friends:
>>
>>I've been developing a system which has textboxes which must accept barcodes.
>>
>>I've been testing it with a scanner which is programmed with 1 CR suffix.
>>
>>But as I know there are a few clients who have scanners with no CR suffix and with lost manuals or they can't be located I decided to test my program with no CR suffix.
>>
>>I thought my code worked till an hour ago... But it doesn't.
>>
>>I know 3 (three) kind of barcode: 8-13 and more than 13 for products.
>>
>>I programmed keypressed event. If digits procesed are 8 I do this:
>>
>>a=CHRSAW()
>>IF !a
>> b=CHRSAW(0.4)
>> IF !B
>> KEYBOARD CHR(13)
>> ENDIF
>>ENDIF
>>
>>I know VFP HELP lies but perhaps I'm wrong in this case.
>>
>>CHRSAW() reads keyboard buffer and I supposed keyboard buffer is independent from keypressed event. So if I "see" for next key I should know there are keystrokes pendent of being processed.
>>
>>If so I don't perform a KEYBOARD CHR(13) command.
>>
>>The easy way is telling my client:
>>
>>Since now you must press enter!
>>
>>And the easy answer is telling me:
>>
>>The other system (DOS CLIPPER) was better!!!
>>
>>Any idea?
>>
>>Thank you.
>>
>> Héctor
Christian Isberner
Software Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform