<span style='font-family:Verdana'><span style='font-size:12px'>Hi!<br /><br />Is it possible that the presence of #02 and/or #03 in the string read by scanner cause the code read not to be showed in the corresponding edit box?<br />I see 2 <span class="descricao">possibilities here. As below:<br /><br />1. The string read by the scanner is not pssed to edit box<br /><br />2. The string read by the scanner is passed to the edit box but it remains in blank 'cause of special characters #02 and/or #03.<br /><br />In your opinion, wich is the most </span><span class="descricao">probable possibility in this case?<br /><br />I confess I didn't consider the item 2 above...<br /><br />Cheers</span><p style="margin:0px; padding:0px;" > </p><blockquote style="border-left: 1px solid #CCC; padding-left: 5px; margin-left: 5px; margin-bottom: 0px; margin-top: 0px; margin-right: 0px;" type="cite"><p style="margin:0px; padding:0px;" ><span style="font-family:Verdana"><span style="font-size:12px">----- Original Message -----</span></span></p><p style="margin:0px; padding:0px;" ><span style="font-family:Verdana"><span style="font-size:12px">From: Antonio Fortuny</span></span></p><p style="margin:0px; padding:0px;" ><span style="font-family:Verdana"><span style="font-size:12px">Sent: 03/21/13 12:26 PM</span></span></p><p style="margin:0px; padding:0px;" ><span style="font-family:Verdana"><span style="font-size:12px">To: lazarus@lists.lazarus.freepascal.org</span></span></p><p style="margin:0px; padding:0px;" ><span style="font-family:Verdana"><span style="font-size:12px">Subject: Re: [Lazarus] Fw: Re: One last ask for help</span></span></p> <div><div><pre style="white-space: pre-wrap; word-wrap: break-word; font-size:11;pre">Le 21/03/2013 15:02, "Arí Ricardo Ody" a écrit :
> Hi Ricardo. ---> Hi Antonio As of my last experience (Datalogic, Motorola former Symbol models, all using WinCE)
the scanner itself needs to be very carefully configured. --->Can tell
little bit more about this?
Depends on each model. There should be some kind of program to set the
scanner config
Usually tap button Windows, on the applications screen select Settings,
then there should be a program specific to the hardware having a barcode
icon of so.
---> In my application user must see the code scanned. Are you
suggesting that I can't see the code because I wait the input in a TEdit?
No, it seems that the characters from the scaaner are not sent to the
wright place
If I use a TLabel it will be showed?
You can"t manage to use a direct input as the TLabel is not input
capable. You can only change the caption by assignment
---> What is the exactly use of this event in this case?
set MyForm.KeyPreview to True;
set MyForm.OnKeyPress to an event (i.e. MyFormKeyPress)
procedure TMyForm.FormKeyPress(Sender: TObject; var Key: char);
begin
case Ord(Key) of
{$IFDEF WIN32}
Ord('>'), // this helps to simulate on Win32
{$ENDIF}
Ord(#03): begin // aka EOT
Key := #0;
try
if Scann.Buffer = EmptyStr then
Exit;
codebarre := scann.buffer;
...
... do whatever has to be done with the scannes barcode
...
finally
Scann.Reset;
Scann.Reading := False;
end
end;
{$IFDEF WIN32}
Ord('<'), // this helps to simulate on Win32
{$ENDIF}
Ord(#02): begin // aka STX
Scann.Reset;
Key := #0; // ignore key
Scann.Reading := True;
end
else begin
Scann.Buffer := Scann.Buffer + Key;
Key := #0; // ignore key
end
end
end;
I open a nem porject in Lazarus 1.0 RC1(Is the only one I have in this
machine in my work) and can't find the KeyPreview event.
see above
--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</pre></div></div></blockquote><p style="margin:0px; padding:0px;" > </p></span></span>