PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Properties specific to the description of BarCodes variables
  • Correspondence between the ..Content and ..TypeContent properties
  • Functions that use the BarCodes variables
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
The BarCodes type is used to handle the information found in a bar code. The characteristics of this bar code can be defined and modified by several WLanguage properties.
The BarCodes type can be used as follows:
  • WINDEV The BarCodes type is mainly used to:
    • generate QR Code bar codes in the windows and reports.generate bar codes in the windows and reports.
    • decode the QR Code bar codes (found in an image).
    • print the bar codes (iPrintBarCode).
  • WEBDEV - Server code The BarCodes type is mainly used to:
    • Versions 17 and later
      generate QR Code bar codes in the pages.
      New in version 17
      generate QR Code bar codes in the pages.
      generate QR Code bar codes in the pages.
      generate bar codes in the pages.
    • generate QR Code bar codes in the reports.generate bar codes in the reports.
    • print the bar codes (iPrintBarCode).
  • Android The BarCodes type is mainly used to:
    • decode the bar codes read by the device camera.
    • Versions 22 and later
      generate bar codes in the windows.
      New in version 22
      generate bar codes in the windows.
      generate bar codes in the windows.
  • Windows Mobile The BarCodes type is mainly used to decode the QR Code bar codes found in an image.
Versions 17 and later
  • iPhone/iPad The BarCodes type is mainly used to:
    • generate QR Code bar codes in the windows.
    • decode the bar codes read by the device camera.
    • decode the QR Code bar codes found in an image.
    • Versions 18 and later
      print the bar codes (iPrintBarCode).
      New in version 18
      print the bar codes (iPrintBarCode).
      print the bar codes (iPrintBarCode).
New in version 17
  • iPhone/iPad The BarCodes type is mainly used to:
    • generate QR Code bar codes in the windows.
    • decode the bar codes read by the device camera.
    • decode the QR Code bar codes found in an image.
    • Versions 18 and later
      print the bar codes (iPrintBarCode).
      New in version 18
      print the bar codes (iPrintBarCode).
      print the bar codes (iPrintBarCode).
  • iPhone/iPad The BarCodes type is mainly used to:
    • generate QR Code bar codes in the windows.
    • decode the bar codes read by the device camera.
    • decode the QR Code bar codes found in an image.
    • Versions 18 and later
      print the bar codes (iPrintBarCode).
      New in version 18
      print the bar codes (iPrintBarCode).
      print the bar codes (iPrintBarCode).
Note: See Declaring a variable for more details.
Versions 17 and later
Ajax This type of variable is now available in the Ajax pages and processes.
iPhone/iPad This type of variable is now available in the iPhone/iPad applications.
Linux This type of variable is now available in the Linux applications and sites.
New in version 17
Ajax This type of variable is now available in the Ajax pages and processes.
iPhone/iPad This type of variable is now available in the iPhone/iPad applications.
Linux This type of variable is now available in the Linux applications and sites.
Ajax This type of variable is now available in the Ajax pages and processes.
iPhone/iPad This type of variable is now available in the iPhone/iPad applications.
Linux This type of variable is now available in the Linux applications and sites.
Versions 20 and later
Universal Windows 10 App This type of variable is now available in Windows Store apps mode.
New in version 20
Universal Windows 10 App This type of variable is now available in Windows Store apps mode.
Universal Windows 10 App This type of variable is now available in Windows Store apps mode.
Example
Android
// Decode a QR Code bar code
bc is BarCodes
bc = BCCapture()
IF ErrorOccurred = False _AND_ bc..TypeContent = bcTypeEmail THEN
    Info("Email address: " + bc..RoughValue)
END
MyQRCode is BarCodes
MyQRCode..ContentType = bcTypeText
MyQRCode..TypeBarCode = BC_QRCODE
MyQRCode..Content = "http://www.windev.com"
// Assign to a Bar Code control
BCOD_NoName1 = MyQRCode
Remarks

Properties specific to the description of BarCodes variables

The following properties can be used to handle a bar code:
Property nameType usedEffect
ContentAny typeValue of bar code.
  • For the QR Code bar codes, the type of this value depends on ..ContentType.
    See the note below to find out the correspondence between the type of content and the type of value.
  • For the bar codes other than QR Code, when reading a bar code, this property is always a "Character string" property and its value is identical to the value of ..RoughValue.
CorrectionErrorInteger constantCorrection level of error: used to define the threshold for reading a damaged bar code.
This property is available for:
  • the QR Code bar codes.
  • the PDF-417 bar codes.
  • Versions 21 and later
    the Aztec bar codes.
    New in version 21
    the Aztec bar codes.
    the Aztec bar codes.
The following constants are available for the QR Code:
  • qrcodeLevelH: about 30% of encoded words can be restored.
  • qrcodeLevelL: about 7% of encoded words can be restored.
  • qrcodeLevelM: about 15% of encoded words can be restored.
  • qrcodeLevelQ: about 25% of encoded words can be restored.
The selected correction level triggers:
  • the resizing of bar code.
  • the modification of the maximum number of characters allowed in the bar code.
A higher correction level means that the drawing of the bar code will have an important size and that less data will be drawn. On the contrary, a higher correction level means that the bar code will be readable even if the support is damaged.
Tips:
  • If the bar code contains a URL, the level L is sufficient.
  • If a logo is inserted into the bar code, we recommend that you use a higher level (M or Q).
  • If the bar code is intended for printing labels for a warehouse, the level H must be used.
For the PDF-417 bar codes, the correction level of the error corresponds to an integer included between 0 and 8.
Versions 21 and later
For the Aztec bar codes, the correction level corresponds to an integer included between 5 and 95, representing the percentage of error correction. The default value is 33. If the given value is
  • less than 5, the value will be set to 5,
  • greater than 95, the value will be set to 95,
  • negative, the value will be set to 33 (default value).
New in version 21
For the Aztec bar codes, the correction level corresponds to an integer included between 5 and 95, representing the percentage of error correction. The default value is 33. If the given value is
  • less than 5, the value will be set to 5,
  • greater than 95, the value will be set to 95,
  • negative, the value will be set to 33 (default value).
For the Aztec bar codes, the correction level corresponds to an integer included between 5 and 95, representing the percentage of error correction. The default value is 33. If the given value is
  • less than 5, the value will be set to 5,
  • greater than 95, the value will be set to 95,
  • negative, the value will be set to 33 (default value).
Android This property is not available.
OptionsInteger constant (or combination of constants)Characteristics of bar code. These characteristics are mainly used when a bar code is printed by iPrintBarCode. The following constants can be used:
  • BC_Bottom: Bar code located at the bottom of destination rectangle.
  • BC_ControlDigits: Bar codes containing control characters (valid for the BC_CODE128, BC_DATAMATRIX, BC_EAN128, CB_GS1_128 and BC_PDF417 bar codes). By default, the control characters are enclosed between the "<" and ">" characters. In order for these characters not to be interpreted as control characters, they must be doubled.
    See The different types of bar codes for more details.
  • BC_CheckDigits: Bar codes containing check characters (valid for the BC_CODE128, BC_DATAMATRIX, BC_EAN128, CB_GS1_128 and BC_PDF417 bar codes).
    If this option is selected, the BC_ControlDigits and BC_Charsets constants are automatically taken into account.
  • BC_CenterH: Bar code centered horizontally in the destination rectangle.
  • BC_CenterV: Bar code centered vertically in the destination rectangle.
  • BC_Right: Bar code aligned to right in the destination rectangle.
  • BC_Extended: Extended bar code (valid for the BC_CODE39 and BC_CODE93 bar codes only).
  • Versions 18 and later
    BC_FormatText: Formats the text displayed for the EAN 128 bar codes: brackets are added around AIs in the printed text.
    New in version 18
    BC_FormatText: Formats the text displayed for the EAN 128 bar codes: brackets are added around AIs in the printed text.
    BC_FormatText: Formats the text displayed for the EAN 128 bar codes: brackets are added around AIs in the printed text.
  • BC_Left: Bar code aligned to left in the destination rectangle.
  • BC_Top: Bar code located at the top of destination rectangle.
  • BC_IgnoreFormatting: Ignores the brackets found in a 128, EAN-128 or GS1-128 bar code (valid for the BC_CODE128, BC_EAN128 and CB_GS1_128 bar codes only).
    The brackets allow the users to easily read the bar code but they are not drawn in the code.
  • BC_Charsets: Bar code using one or more sets of characters in order to compress the bar code. This set of characters must be defined in the value of bar code.
    See The different types of bar codes for more details.
  • BC_NotProportional: Adjusts the bar code to the size of destination rectangle.
  • BC_NoText: Displays the text below the bar code.
    The text is normalized for the BC_UPCA, BC_UPCE, BC_EAN13 and BC_EAN8 bar codes.
    For the other types of bar codes, the text can exceed the display border of bar code.
  • BC_Check: Bar code with check characters (valid for the BC_CODE39, BC_CODE93, BC_INTER2OF5 and BC_CODABAR bar codes only).
  • BC_Vertical: Prints the bar code vertically.
  • BC_90: Prints the bar code vertically.
  • BC_180: Prints the bar code while performing a rotation equal to 180 degrees.
  • BC_270: Prints the bar code while performing a rotation equal to 270 degrees.
Android This property is not available.
TypeBarCodeInteger constantType of bar code:
  • Versions 21 and later
    BC_AZTEC: AZTEC bar code.
    iPhone/iPad This type of bar code is available from iOS 7.
    New in version 21
    BC_AZTEC: AZTEC bar code.
    iPhone/iPad This type of bar code is available from iOS 7.
    BC_AZTEC: AZTEC bar code.
    iPhone/iPad This type of bar code is available from iOS 7.
  • Versions 21 and later
    BC_MAXICODE: MaxiCode bar code.
    Versions 22 and later
    Android Not available.
    New in version 22
    Android Not available.
    Android Not available.
    New in version 21
    BC_MAXICODE: MaxiCode bar code.
    Versions 22 and later
    Android Not available.
    New in version 22
    Android Not available.
    Android Not available.
    BC_MAXICODE: MaxiCode bar code.
    Versions 22 and later
    Android Not available.
    New in version 22
    Android Not available.
    Android Not available.
  • BC_QRCODE: QR Code bar code. This constant is used by default when creating a BarCode variable.
  • BC_UPCA: UPC-A bar code.
  • BC_UPCE: UPC-E bar code.
  • BC_EAN8: EAN8 bar code.
    iPhone/iPad Not available.
    Versions 20 and later
    iPhone/iPad This type of bar code is available from iOS 7.
    New in version 20
    iPhone/iPad This type of bar code is available from iOS 7.
    iPhone/iPad This type of bar code is available from iOS 7.
  • BC_EAN13: EAN13 bar code.
    iPhone/iPad Not available.
    Versions 20 and later
    iPhone/iPad This type of bar code is available from iOS 7.
    New in version 20
    iPhone/iPad This type of bar code is available from iOS 7.
    iPhone/iPad This type of bar code is available from iOS 7.
  • BC_CODE39: Code39 bar code.
    iPhone/iPad Not available.
    Versions 20 and later
    iPhone/iPad This type of bar code is available from iOS 7.
    New in version 20
    iPhone/iPad This type of bar code is available from iOS 7.
    iPhone/iPad This type of bar code is available from iOS 7.
  • BC_CODE93: Code93 bar code.
    iPhone/iPad Not available.
    Versions 20 and later
    iPhone/iPad This type of bar code is available from iOS 7.
    New in version 20
    iPhone/iPad This type of bar code is available from iOS 7.
    iPhone/iPad This type of bar code is available from iOS 7.
  • BC_CODE128: EAN128 bar code.
    iPhone/iPad Not available.
    Versions 20 and later
    iPhone/iPad This type of bar code is available from iOS 7.
    New in version 20
    iPhone/iPad This type of bar code is available from iOS 7.
    iPhone/iPad This type of bar code is available from iOS 7.
    Versions 22 and later
    Android This type of bar code is not available.
    New in version 22
    Android This type of bar code is not available.
    Android This type of bar code is not available.
  • Versions 18 and later
    CB_GS1_128: GS1-128 bar code (new name for the EAN128 bar code).
    New in version 18
    CB_GS1_128: GS1-128 bar code (new name for the EAN128 bar code).
    CB_GS1_128: GS1-128 bar code (new name for the EAN128 bar code).
  • BC_INTER2OF5: Interleaved 2 of 5 bar code.
    AndroidiPhone/iPad This type of bar code is not available.
  • Versions 22 and later
    Android BC_UNKNOWN: Bar code decoded by BCCapture with an unrecognized type.
    Note: This constant is available in read-only.
    New in version 22
    Android BC_UNKNOWN: Bar code decoded by BCCapture with an unrecognized type.
    Note: This constant is available in read-only.
    Android BC_UNKNOWN: Bar code decoded by BCCapture with an unrecognized type.
    Note: This constant is available in read-only.
  • BC_DATAMATRIX: DATAMATRIX bar code.
    iPhone/iPad This type of bar code is not available.
  • BC_PDF417: PDF417 bar code.
    iPhone/iPad Not available.
    Versions 20 and later
    iPhone/iPad This type of bar code is available from iOS 7.
    New in version 20
    iPhone/iPad This type of bar code is available from iOS 7.
    iPhone/iPad This type of bar code is available from iOS 7.
  • BC_CODABAR: Codabar bar code.
  • BC_CODE11: Code11 bar code.
    Versions 22 and later
    Android This type of bar code is not available.
    New in version 22
    Android This type of bar code is not available.
    Android This type of bar code is not available.
  • BC_EAN128: EAN128 bar code.
    Versions 22 and later
    Android This type of bar code is not available.
    New in version 22
    Android This type of bar code is not available.
    Android This type of bar code is not available.
  • BC_MSI: MSI bar code.
    Versions 22 and later
    Android This type of bar code is not available.
    New in version 22
    Android This type of bar code is not available.
    Android This type of bar code is not available.
These types are also available for the prints performed by iPrintBarCode.
ContentTypeInteger constantNature of data stored in the bar code:
  • bcTypeText (default value when creating the variable): Rough text
  • bcTypePhone: Phone number
  • bcTypeSMS: SMS number
  • bcTypeEmail: Email address
  • bcTypeContact: Contact description
  • bcTypeLocation: Geographical position
  • bcTypeURL: URL (bookmark). To insert an http address into the bar code, use the cbTypeText type.
    This constant is kept for backward compatibility and it must be used in very specific cases.
  • bcTypeMarket: Link to an application on Google Play (for an Android application only)
  • bcTypeWiFi: Parameters for connecting to a Wi-Fi network (for an Android application only)
Note: These kinds of data are available for the 2D bar codes (QR Code, Aztec, datamatrix, PDF417, ...). For the bar codes other than 2D bar codes, the data is always text data.
RoughValueUnicode character stringRough value of bar code.
For the bar codes other than the QR Code bar codes, the value of this property is identical to the one of ..Content.
This property is available in read-only.
Android This read-only property contains the value of bar code as it was read by BCCapture independently of the nature of data stored in the bar code.
For example, this property corresponds to "mailto:adresse@mail.com" if a QR Code containing an email address is decoded.

Note: These properties can be used with one of the following syntaxes:
  • <Variable Name>..<Property Name>
  • <Variable Name>.<Property Name>

Correspondence between the ..Content and ..TypeContent properties

Type of contentType of value (..Content)Note
bcTypeTextCharacter stringExample: "WinDev is great!"
bcTypePhoneCharacter stringExample: "0612345678"
bcTypeSMSCharacter string
In read mode: The members of the SMS structure (SMS.Message and SMS.Number) will be automatically filled with the values read in the bar code. the content will correspond to a string in the following format: <Number> + CR + <Message>
In generation: If they exist, the members of the SMS structure (SMS.Message and SMS.Number) will be automatically taken into account. You also have the ability to use a character string in the following format: <Number> + CR + <Message>
Example: "0612345678<CR>Text to send"
bcTypeURLCharacter string
Corresponds to a bookmark. The content will be encoded in the following format: "urlto::URL". For example: "urlto::http://www.windev.com". Some decoders do not support this type of content.
To specify an http address, use the cbTypeText type.
Note: This constant is kept for backward compatibility and it must be used in very specific cases.
Example: "http://www.google.com"
bcTypeMarketCharacter stringExample: "market://search?q=pname:com.company.application"
bcTypeWiFiCharacter stringCharacter string in the following format:
<SSID> + TAB + <Security Protocol>+ TAB + <Key>
Example: "MyNetwork<TAB>WPA<TAB>pwd"
bcTypeEmailCharacter stringExample: "name@email.com"
bcTypeContactEmpty.
In read mode: The members of the mContact structure will be automatically filled with the values read in the bar code.
In generation: The members of the mContact structure will be automatically used to generate the bar code.
bcTypeLocationgeoPosition variable.
In read mode: The ..Latitude and ..Longitude properties of the variable will be automatically filled with the values read in the bar code.
In generation: The ..Latitude and ..Longitude properties of the variable will be automatically used to generate the bar code.

Functions that use the BarCodes variables

Versions 16 and later
BCCapture
New in version 16
BCCapture
BCCapture
Decodes the information stored in a bar code by using the device camera (Android, iPhone, iPad).
Versions 16 and later
BCDecode
New in version 16
BCDecode
BCDecode
Decodes the information stored in a QR Code bar code.
Versions 09 and later
iPrintBarCode
New in version 09
iPrintBarCode
iPrintBarCode
Prints a bar code (inside a rectangle).
Note: To reinitialize the content of a BarCodes variable, you have the ability to use VariableReset.
Related Examples:
Android Inventory Android (WINDEV Mobile): Android Inventory
[ + ] This application is used to perform inventories and to save the results in a database.
Minimum required version
  • Version 16
This page is also available for…
Comments
Click [Add] to post a comment