PC SOFT

WINDEV的在线文档

  • 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
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

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.

17版本和更高版本
Linux The Bar Code control can now be handled by programming in the Linux sites and applications.
17新版本
Linux The Bar Code control can now be handled by programming in the Linux sites and applications.
Linux The Bar Code control can now be handled by programming in the Linux sites and applications.
18版本和更高版本
WinDevLinux This type of control is now available in the WinDev applications in Linux.
18新版本
WinDevLinux This type of control is now available in the WinDev applications in Linux.
WinDevLinux This type of control is now available in the WinDev applications in Linux.

20版本和更高版本
WinDevWindows Store apps This type of control is now available in Windows Store apps mode.
20新版本
WinDevWindows Store apps This type of control is now available in Windows Store apps mode.
WinDevWindows Store apps This type of control is now available in Windows Store apps 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.

Some examples:

  • direct assignment:
    BCOD_BarCodeControl"123456789"
  • assignment by variable:
    BCOD_BarCodeControlProducts.BarCode
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 条形码型 variable.
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 条形码型 variable.
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 条形码型 variable.

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 屏幕填充到数据库表 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:
    09版本和更高版本
    串行端口打开
    串行端口打开
    Opens and initializes:
    • a serial port.
    • a parallel port.
    • an infrared port.
    09版本和更高版本
    串行端口读
    09新版本
    串行端口读
    串行端口读
    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整数型13
// Number of pending bytes in the buffer
NbPendingBytes整数型
BufferPrn字符串型 // Content of the buffer
SerialPort整数型1 // Serial port COM1

// Open and initialize the serial port COM1
如果串行端口打开SerialPort50005000),那么
// Read the bar code
// Retrieve the number of pending bytes
NbPendingBytes串行端口输入缓存字节数量SerialPort
// Retrieve the value of the bar code only
// if at least 13 characters have been read
如果NbPendingBytes大于等于NbCharToRead,那么
BufferPrn串行端口读SerialPortNbPendingBytes
// Retrieve the first 13 characters read
BufferPrn左边取值BufferPrn13
// Display the value of the bar code in the
// "EDT_BarCode" edit control
EDT_BarCodeBufferPrn
结束
结束

Retrieving the value of the bar code displayed in the Bar Code control
WinDevWindows Store apps To retrieve the value of the bar code displayed in a Bar Code control:
  • a simple assignment is sufficient.
    For example:
    BarCodeValueBarCodeControl
  • retrieve part of the value.
    For example:
    BeginningBarCode左边取值BarCodeControl3
  • use ..值.

Note: If the control is associated with an item found in a data file, the entered value is automatically retrieved by using 屏幕填充到数据库表. 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.
水平对齐Allows you to find out and modify the horizontal alignment of a Bar Code control.
垂直对齐Allows you to find out and modify the vertical alignment of a Bar Code control.
鼠标拖放目标Allows you to find out and modify the behavior of the target control during Drag and Drop.
鼠标拖放源Allows 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.