#!/bin/sh # MetaCard 2.4 stack # The following is not ASCII text, # so now would be a good time to q out of more exec mc $0 "$@" öBarcode tester ˆ î-- this routine reads the barcode -- one character at a time -- on keyDown theKey if the hilite of btn "Read codes" then put theKey after fld "Barcodes" else pass keyDown end if end keyDown -- this routine looks for the barcodes end of line character -- in this tester, it just adds a linefeed -- but in a real application, this is where -- you would handle the barcode information -- on rawKeyDown theKey if the hilite of btn "Show raw data" = false then if theKey = 65293 and the hilite of btn "Read codes" then put cr after fld "Barcodes" -- here is where you would handle the complete barcode else pass rawKeyDown end if else put theKey & cr after fld "Barcodes" end if end rawKeyDown wÜÜÜÜÜÜffffffÿÿÿÿÿÿwhite€€€€€€¬¬¬¬¬¬€igÐL revstackfalse UGeneva UChicago UChicago @UGeneva Menubar 1 cREVGeneralscriptChecksum¶ ü>înAA7-- this routine reads the barcode

-- one character at a time

--

on keyDown theKey

if the hilite of btn "Read codes" then

put theKey after fld "Barcodes"

else

pass keyDown

end if

end keyDown

-- this routine looks for the barcodes end of line character

-- in this tester, it just adds a linefeed

-- but in a real application, this is where

-- you would handle the barcode information

--

on rawKeyDown theKey

if the hilite of btn "Show raw data" = false then

if theKey = 65293 and the hilite of btn "Read codes" then

put cr after fld "Barcodes"

-- here is where you would handle the complete barcode

else

pass rawKeyDown

end if

else

put theKey & cr after fld "Barcodes"

end if

end rawKeyDown

ê @ÐLëíòóôõ ë Barcodes‡ `€4Ãù cREVGeneral revUniqueID 1004076137154 ê ñ`¹5÷íClearàE«x9on mouseUp put empty into fld "Barcodes" end mouseUp €D2Kcommandfalse cREVGeneral revUniqueID 1004076159836 bookmarks handlerListmouseUp tempScript prevHandlermouseUpscriptSelection char 11 to 10script ò Read codes`E©€ d cREVGeneral revUniqueID 1036717097974 óShow raw data`E©€ d cREVGeneral revUniqueID 1036717115120 ôHelpâC«PYon mouseUp set the visible of fld "Help" to not the visible of fld "Help" end mouseUp €¦ 4Y cREVGeneralscriptChecksum·îáŽå†²ÜY΋ÔÔ—¬} revUniqueID 1036717410050 bookmarks handlerListmouseUp tempScript prevHandlerscriptSelection char 76 to 75scriptà

on mouseUp

set the visible of fld "Help" to not the visible of fld "Help"

end mouseUp

õHelpp‚on mouseUp hide me end mouseUp on linkClicked pLink revGoURL "mailto:" & pLink & "?subject=Barcoder tester" end linkClicked €0Ä cREVGeneralscriptChecksum—rU*MÕrIÈ>É‚u¹ revUniqueID 1036717457215 bookmarks handlerListmouseUp linkClicked tempScript prevHandlermouseUpscriptSelectionchar 113 to 112scriptJ

on mouseUp

hide me

end mouseUp

on linkClicked pLink

revGoURL "mailto:" & pLink & "?subject=Barcoder tester"

end linkClicked

ê yThis is a simple stack for reading data from a keyboard-wedge barcode scanner. The handlers are all in the stack script. =To read from the scanner, turn on the "Read codes" checkbox. You may need to find out what character codes are coming from the scanner, especially to find out what end-of-line character is sent. To do this, turn on "Show raw data" and check the exact codes. The end-of-line code needs to be used in the rawKeyDown handler. Sarah Reichelt sarahr@genesearch.com.au