From Clomosy Docs

Revision as of 14:55, 8 April 2025 by ClomosyManager (talk | contribs) (Created page with "<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert"> procedure CallBarcodeReaderWithScript(TargetObject: TCLComponent; OnAfterScript:String); </div> <span style="color:blue"><b>TargetObject</b></span> : An object name (such as TclEdit or TclLabel) where textual data will be added must be specified. After the barcode scanning process is completed, the scanned code is transferred to the designated textual object.<br>...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

TargetObject : An object name (such as TclEdit or TclLabel) where textual data will be added must be specified. After the barcode scanning process is completed, the scanned code is transferred to the designated textual object.

OnAfterScript : The command script contains the instructions to be executed after the barcode scanning process is completed. The script is typically a void type. This allows a specific action to be performed after the reading operation is finished.

This process enables the transfer of the detected serial number from barcodes into an electronic environment. Following this step, the transmitted information is analyzed on the computer or terminal, and the result is displayed, allowing data entry to be performed much faster and more accurately.

Example

var
  Form1:TCLForm;
  Lbl1 : TclLabel;
  Btn1 : TclButton;

void OnBarcodeScanned;
{
  ShowMessage(Lbl1.Text);
}
void ReadBarcode;
{
  Form1.CallBarcodeReaderWithScript(Lbl1,'OnBarcodeScanned')
}

{
  Form1 = TCLForm.Create(Self);
  
  Lbl1 = Form1.AddNewLabel(Form1,'Lbl1','-----');
  Lbl1.Align = alTop;
  Lbl1.Margins.Left = 10;
  
  Btn1 = Form1.AddNewButton(Form1,'Btn1','Scan Barcode!');
  Btn1.Align = AlBottom;
  Btn1.Height = 30;
  Btn1.Margins.Bottom = 15;
  Btn1.StyledSettings = ssFamily;
  Btn1.TextSettings.Font.Size = 20;
  Btn1.TextSettings.FontColor = clAlphaColor.clHexToColor('#8a067c');
  Form1.AddNewEvent(Btn1,tbeOnClick,'ReadBarcode');
  
  Form1.Run;
}

See Also