sirWimelef Posted September 29, 2009 Share Posted September 29, 2009 hi, im trying to make an a simple interface to get data from a ps2 barcode reader and put them to a sql db to make it more automaticly im trining to count how many keys are pushed each reading to send a {tab} key after it to go to de the next field after serch for a while i only fount the _iffpressed function but i don't need(/want) to make a especific rule for each key theres any generic function to count how many pushes are pressed? the gui of the program expandcollapse popup#NoTrayIcon #include <GuiConstants.au3> Opt("MustDeclareVars",1) HotKeySet("{PAUSE}", "request_end") global $Maingui=GuiCreate("Codis Postals", 300, 220,@DesktopWidth/2-150,@DesktopHeight/2-200, 349110272) dim $msg GUICtrlCreateLabel("Nº Lot",5,10) dim $nlot=GUICtrlCreateInput("",60,5,80,20,0x0008) GUICtrlCreateLabel("Codi equip",5,35,50) dim $Cequip=GUICtrlCreateInput("",60,30,80,20,0x0008) GUICtrlCreateLabel("Simptomes",5,60,55) dim $error1=GUICtrlCreateInput("",60,55,80,20,0x0008) dim $error2=GUICtrlCreateInput("",60,75,80,20,0x0008) dim $error3=GUICtrlCreateInput("",60,95,80,20,0x0008) GUICtrlCreateLabel("Material",5,125,55) dim $Mat1 = GUICtrlCreateInput("",60,120,80,20,0x0008) dim $Mat2 = GUICtrlCreateInput("",60,140,80,20,0x0008) dim $mat3 = GUICtrlCreateInput("",60,160,80,20,0x0008) GUICtrlCreateLabel("Observacions",160,10,55) dim $mat3 = GUICtrlCreateInput("",160,30,120,150,0x0004) Dim $Next = GUICtrlCreateButton("Seguent",120,190,60,25) While 1 $msg = GuiGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit ;~ case $buscar ;~ Buscar() EndSwitch WEnd Func connmvx() Local $sqlCon = ObjCreate("ADODB.Connection") $sqlCon.Open("Driver={SQL Server};Server=****;Database=MoVeX;Uid=;Pwd=;") Return $sqlCon EndFunc func request_end() ;paro de emergencia if MsgBox(4,"movex", "End script?") =6 then Exit endif endfunc Link to comment Share on other sites More sharing options...
Bert Posted September 29, 2009 Share Posted September 29, 2009 A barcode reader will send the barcode as text. If your text is a certain length, then do a string length count and use that as your break. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now