PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Handling a Bar Code control by programming
Overview
WINDEV, WEBDEV and WINDEV Mobile allow you to handle a Bar Code control by programming. 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.
WEBDEV - Server codeWINDEV Mobile The Bar Code control can be handled by programming in the report editor only.
Windows Mobile The Bar Code control can be handled by programming in the report editor only.
Versions 17 and later
WEBDEV - Server code The Bar Code control can now be handled by programming in the WEBDEV sites.
iPhone/iPad The Bar Code control can now be handled by programming in the iPhone/iPad applications.
Linux The Bar Code control can now be handled by programming in the Linux sites and applications.
New in version 17
WEBDEV - Server code The Bar Code control can now be handled by programming in the WEBDEV sites.
iPhone/iPad The Bar Code control can now be handled by programming in the iPhone/iPad applications.
Linux The Bar Code control can now be handled by programming in the Linux sites and applications.
WEBDEV - Server code The Bar Code control can now be handled by programming in the WEBDEV sites.
iPhone/iPad The Bar Code control can now be handled by programming in the iPhone/iPad applications.
Linux The Bar Code control can now be handled by programming in the Linux sites and applications.
Versions 18 and later
WINDEVLinux This type of control is now available in the WINDEV applications in Linux.
iPhone/iPad This type of control is now available for the reports in the iPhone/iPad applications.
New in version 18
WINDEVLinux This type of control is now available in the WINDEV applications in Linux.
iPhone/iPad This type of control is now available for the reports in the iPhone/iPad applications.
WINDEVLinux This type of control is now available in the WINDEV applications in Linux.
iPhone/iPad This type of control is now available for the reports in the iPhone/iPad applications.
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 the windows and reports found in the applications in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This type of control is now available for the windows and reports found in the applications in Universal Windows 10 App mode.
Universal Windows 10 App This type of control is now available for the windows and reports found in the applications in Universal Windows 10 App mode.
Versions 22 and later
Android This type of control is now available for the Android applications.
New in version 22
Android This type of control is now available for the Android applications.
Android This type of control is now available for the Android applications.
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.
Some examples:
  • direct assignment:
    BCOD_BarCodeControl = "123456789"
  • assignment by variable:
    BCOD_BarCodeControl = Products.BarCode
Versions 16 and later
Case of QR Code bar codes:
To display a QR Code bar code in a Bar Code control, you have the ability to use a BarCodes variable.
AndroidiPhone/iPad For example:
// Decode a QR Code bar code
MyQRCode is BarCodes
MyQRCode = BCCapture()
IF ErrorOccurred = False THEN
BCOD_MyBarCodeControl = MyQRCode
END
New in version 16
Case of QR Code bar codes:
To display a QR Code bar code in a Bar Code control, you have the ability to use a BarCodes variable.
AndroidiPhone/iPad For example:
// Decode a QR Code bar code
MyQRCode is BarCodes
MyQRCode = BCCapture()
IF ErrorOccurred = False THEN
BCOD_MyBarCodeControl = MyQRCode
END
Case of QR Code bar codes:
To display a QR Code bar code in a Bar Code control, you have the ability to use a BarCodes variable.
AndroidiPhone/iPad For example:
// Decode a QR Code bar code
MyQRCode is BarCodes
MyQRCode = BCCapture()
IF ErrorOccurred = False THEN
BCOD_MyBarCodeControl = MyQRCode
END
Note: In a window or in a page, if the control is associated with an item found in a data file, the entered value is automatically retrieved by using ScreenToFile or PageToFile. See Linking a Bar Code control to an item for more details.
WINDEV

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

You have the ability to read the bar codes and to 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 = BarCodeControl
  • retrieve part of the value.
    For example:
    BeginningBarCode = Left(BarCodeControl, 3)
  • use ..Value.
Note: If the control is associated with a file item, the value typed is automatically retrieved by using ScreenToFile. See Linking a Bar Code control to an item for more details.
Properties specific to the Bar Code controls
The following properties are used to manage a Bar Code control by programming.
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.
To find out the entire list of WLanguage properties that can be used with a Bar Code control, see Properties associated with a Bar Code control.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment