gavin_wusj
9th January 2006, 08:17
Hi,
We ask user key in the data via barcode device, and need forbid key in via keyboard, how can I do?
Thanks for your attention!
Gavin
1/9
csecgn
9th January 2006, 10:12
Remove the Keyboard and only leave the scanner :D . Sorry, but nearly all scanner using the keyboard as interface.
I normaly use the following code for reading input from a scanner. In the init.form section I start the function and from this point it controls the input.
The code was written for input an EAN13 (and some special functions). The 14th char is Enter what most scanners add as "End of Input". You also could use data.input instead of keyin, but I always got fatal errors (the tests are a few years ago, maybe it works better now).
Shurely the user could also use the keyboard, but most of them don't know.
function start.input.data()
{
long i
string keyin.char(1)
domain tcbool exit.loop
exit.loop = false
| Bildschirm anzeige
modus.f = "Datenerfassung ein"
display("modus.f")
repeat
| das geht eigentlich eleganter über data.input.
| Leider geht der data.input nicht ohne fatal error ....
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
| Eingabe beenden oder Datensatz erzeugen
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")
}
Hope this helps.
Regards
csecgn
Forgotten to write: on the mask no field is needed for input. You ca use an empty mask and handle i.e. database operations in the background.
lbencic
9th January 2006, 17:07
I agree, since the scanners are usually attached to the PC's and look just like keyboard input, there is only the 'stripping off' method inside the Baan GUI, and that is industry standard, though it can be gotten around once the users figure it out. We have a bar coding system, with Time and Attendance, and the security of this method is sometimes not sufficient.
If you can interface to the real scanners - ie Intermec, DataMax, Symbol etc, then they have the ability to control by field for scanned only, those devices can tell the difference. That's a step up in investment (hardware and middleware of some sort), so your security needs would need to be considered vs. the cost of this type of setup.
gavin_wusj
10th January 2006, 02:45
Thanks for your suggestiong. But I don't know what you said, My means is we only permit keyin data via scanner, and forbid keyboard in specific field. We wish it can avoid keying error.
lbencic
10th January 2006, 21:34
If the scanner is attached to a PC Keyboard, like a keyboard wedge, and you are talking about entering through the Baan GUI, then the only method is as csecgn suggested, to write code that will strip off an extra character that appears only in the barcode.
csecgn
11th January 2006, 14:30
If you want to forbid keyboard in a specific field, you could start the barcode reading in the before.input ection of the field, read and interpret the data, fill up the field with the result and set attr.input for the field to false. So nobody can enter the data directly in the field. Maybe you will need an update.occ() also to switsch the update.status of a tablerecord.
If possible/necessary, prepare the barcode with a secret char (or a checksum). If the input is without the checksum/char, anybody has entered it with a keyboard. IMHO this is the only way to check how the user makes the input if the scanners use the keyboard interface also.
Just an idea.
Regards
csecgn