PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Overview
  • Displaying a bar code in a Bar Code control
  • Displaying a bar code in a Bar Code control
  • Retrieving in a Bar Code control the value read by a specific device
  • Retrieving the value of the bar code displayed in the Bar Code control
  • Properties specific to the Bar Code controls
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Manipulating a Bar Code control programmatically
Overview
WINDEV, WEBDEV and WINDEV Mobile allow you to manipulate a Bar Code control programmatically. To do so, use the variable of the Bar Code control in the code.
The variable of the Bar Code control corresponds to the name of the Bar Code control. This variable is a text variable.
Versions 17 and later
Linux The Bar Code control can now be manipulated programmatically in Linux sites and applications.
New in version 17
Linux The Bar Code control can now be manipulated programmatically in Linux sites and applications.
Linux The Bar Code control can now be manipulated programmatically in Linux sites and applications.
Versions 18 and later
WINDEVLinux This type of control is now available in WINDEV applications in Linux.
New in version 18
WINDEVLinux This type of control is now available in WINDEV applications in Linux.
WINDEVLinux This type of control is now available in WINDEV applications in Linux.
Versions 20 and later
Universal Windows 10 App This type of control is now available in Windows Store apps mode.
New in version 20
Universal Windows 10 App This type of control is now available in Windows Store apps mode.
Universal Windows 10 App This type of control is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This type of control is now available for windows and reports in applications in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This type of control is now available for windows and reports in applications in Universal Windows 10 App mode.
Universal Windows 10 App This type of control is now available for windows and reports in applications in Universal Windows 10 App mode.
Displaying a bar code in a Bar Code control

Displaying a bar code in a Bar Code control

To display a bar code in a Bar Code control, a simple assignment is sufficient.
For example:
  • direct assignment:
    BAC_BarCodeControl = "123456789"
  • assignment by variable:
    BAC_BarCodeControl = Products.BarCode
Versions 16 and later
Case of QR Code bar codes:
To display a QR code in a Bar Code control, you can use a variable of type BarCode.
New in version 16
Case of QR Code bar codes:
To display a QR code in a Bar Code control, you can use a variable of type BarCode.
Case of QR Code bar codes:
To display a QR code in a Bar Code control, you can use a variable of type BarCode.
Remark: In a window or a page, if the control is associated with a data file item, the entered value is automatically retrieved via ScreenToFile or PageToFile. For more details, see Binding Bar Code controls to items.
WINDEV

Retrieving in a Bar Code control the value read by a specific device

You can read the bar codes and display the corresponding value on the screen. To read a bar code:
  1. Connect a specific device to the serial port of your computer.
  2. Read the value of the bar code via the functions for managing the serial ports:
    Versions 09 and later
    sOpen
    New in version 09
    sOpen
    sOpen
    Opens and initializes:
    • a serial port.
    • a parallel port.
    • an infrared port.
    Versions 09 and later
    sRead
    New in version 09
    sRead
    sRead
    Reads a character string in the entry buffer of the specified serial port.
  3. Initialize the value of the bar code read in a Bar Code control corresponding to the type of the bar code read.
Example used to read a bar code with a specific device connected to the serial port COM1:
// Declare the variables
// Define the number of characters that must be read
NbCharToRead is int = 13
// Number of pending bytes in the buffer
NbPendingBytes is int
BufferPrn is string // Content of the buffer
SerialPort is int = 1 // Serial port COM1
 
// Open and initialize the serial port COM1
IF sOpen(SerialPort, 5000, 5000) THEN
// Read the bar code
// Retrieve the number of pending bytes
NbPendingBytes = sInEntryQueue(SerialPort)
// Retrieve the value of the bar code only
// if at least 13 characters have been read
IF NbPendingBytes >= NbCharToRead THEN
BufferPrn = sRead(SerialPort, NbPendingBytes)
// Retrieve the first 13 characters read
BufferPrn = Left(BufferPrn, 13)
// Display the value of bar code in the
// "EDT_BarCode" edit control
EDT_BarCode = BufferPrn
END
END
Retrieving the value of the bar code displayed in the Bar Code control
WINDEVUniversal Windows 10 App To retrieve the value of the bar code displayed in a Bar Code control:
  • perform a simple assignment.
    For example:
    BarCodeValue = BAC_BarCodeControl
  • retrieve part of the value.
    For example:
    BeginningBarCode = Left(BAC_BarCodeControl, 3)
  • use the Value property.
Remark: If the control is associated with a data file item, the entered value is automatically retrieved via ScreenToFile. For more details, see Binding Bar Code controls to items.
Properties specific to the Bar Code controls
The following properties are used to manipulate a Bar Code control programmatically.
HorizontalAlignmentAllows you to find out and modify the horizontal alignment of a Bar Code control.
VerticalAlignmentAllows you to find out and modify the vertical alignment of a Bar Code control.
DndTargetAllows you to find out and modify the behavior of the target control during Drag and Drop.
DndSourceAllows you to find out and modify the behavior of the source control during Drag and Drop.


For a complete list of WLanguage properties that can be used with a Bar Code control, see Properties associated with a Bar Code control.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment