mig28mx
1st April 2008, 19:49
Hello all,
I want to develop a session/table to capture data readed from a bar code scanner. I mean, when a bar code is scaned it have to be inserted on a table.

Anyone have developed something like this?

thanks in advance!

mark_h
1st April 2008, 20:13
Something like that - on mine I just put a tab on each field to move it from field to field. After the last field it did a tab to the enter key - then I had a barcode with enter on it for them to scan. So they can process inventory transfers (bin to bins) in about 5 seconds - as long as they do not make a scanning mistake. Pretty cool to watch them fly through the records. Of course you can always on the last field execute(update.db). My users wanted the option of doing it by hand or by scanner. I am sure others will have different suggestions.

csecgn
2nd April 2008, 10:45
function start.input.data()
{
long i
string keyin.char(1)
domain tcbool exit.loop

exit.loop = false

| display status information
modus.f = "Start data entry"
display("modus.f")

repeat
for i = 1 to 14
refresh()
keyin.char = keyin$()
if keyin.char = chr$(27)
then
exit.loop = add.new.nve()
break
else
if keyin.char <> chr$(13)
and i < 14
then
if keyin.char = "a"
or keyin.char = "A"
then
add.whole.delivery()
result.string = ""
exit.loop = FALSE
break
else
result.string(i;1) = keyin.char
endif
else
exit.loop = false
break
endif
endif
endfor

| Exit data entry or create new record
if not exit.loop
then
in.eanc = result.string

if not isspace(in.eanc)
then
add.new.package(
in.eanc)
endif
endif
result.string = ""
until exit.loop

modus.f = ""
display("modus.f")
}


function add.new.package(
domain tio.eanc i.eanc)
{
domain tcbool entry.ok

domain tcmcs.str17 time.string

entry.ok = TRUE

...

create new record in a table

...

execute(interrupt)
execute(last.set)
}

I use this code for scanning packages to a SSCC (the barcode is EAN13). The form has only two buttons and is a form 3 type (only view, no input fields). After starting the session the function start.input.data() is started automatically.

hth

Regards
Christof