PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Use conditions
  • Managing errors
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
Decodes the information stored in a bar code by using the device camera (Android, iPhone, iPad).
Windows Mobile To decode a bar code in Windows Mobile, use BCDecode.
Versions 21 and later
AndroidiPhone/iPad The Camera control can also be used to decode the bar codes directly. See Camera control: decoding the bar codes for more details.
New in version 21
AndroidiPhone/iPad The Camera control can also be used to decode the bar codes directly. See Camera control: decoding the bar codes for more details.
AndroidiPhone/iPad The Camera control can also be used to decode the bar codes directly. See Camera control: decoding the bar codes for more details.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Android Widget This function is now available in Android Widget mode.
Versions 20 and later
iPhone/iPad Several types of bar codes are now supported (from iOS 7).
New in version 20
iPhone/iPad Several types of bar codes are now supported (from iOS 7).
iPhone/iPad Several types of bar codes are now supported (from iOS 7).
Example
// 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
Syntax
<Result> = BCCapture([<Type of Bar Code> [, <Enable Flashlight>]])
<Result>: BarCodes variable
BarCodes variable initialized with the information read in the bar code.
iPhone/iPad Note: The ..TypeBarCode property of BarCodes variable is not updated: it always corresponds to "QRCode".
<Type of Bar Code>: Optional Integer constant
Type of bar code that can be decoded:
Versions 21 and later
BC_AZTEC
New in version 21
BC_AZTEC
BC_AZTEC
Aztec bar code.
iPhone/iPad This type of bar code is available from iOS 7.
BC_CODE128Code128 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_CODE39Code39 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_CODE93Code93 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_DATAMATRIXDATAMATRIX bar code.
iPhone/iPad Not available.
BC_EAN128EAN128 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_EAN13EAN13 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_EAN8EAN8 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
BC_INTER2OF5
New in version 22
BC_INTER2OF5
BC_INTER2OF5
Interleaved 2 of 5 bar code.
AndroidiPhone/iPad Not available.
iPhone/iPad This type of bar code is available from iOS 7.
BC_PDF417PDF417 bar code.
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.
Android Not available.
Versions 16 and later
BC_QRCODE
New in version 16
BC_QRCODE
BC_QRCODE
QR Code bar code.
BC_UPCAUPC-A bar code.
iPhone/iPad Not available.
BC_UPCEUPC-E 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 20 and later
BC_ALL
New in version 20
BC_ALL
BC_ALL
All the types of bar codes supported by this function can be decoded.

If this parameter is not specified, all types of codes supported by this function can be decoded.
iPhone/iPad Only the QR Code bar codes can be decoded.
Versions 20 and later
iPhone/iPad From IOS 7, the following bar codes can be decoded: QR Code, UPCE, Code39, Code39Mod43, EAN13, EAN8, Code93, Code128, PDF417 and Aztec.
New in version 20
iPhone/iPad From IOS 7, the following bar codes can be decoded: QR Code, UPCE, Code39, Code39Mod43, EAN13, EAN8, Code93, Code128, PDF417 and Aztec.
iPhone/iPad From IOS 7, the following bar codes can be decoded: QR Code, UPCE, Code39, Code39Mod43, EAN13, EAN8, Code93, Code128, PDF417 and Aztec.
<Enable Flashlight>: Optional boolean
Versions 20 and later
iPhone/iPad Mode for managing the flashlight:
  • True to enable the flashlight,
  • False (default value) to avoid activating the flashlight.
New in version 20
iPhone/iPad Mode for managing the flashlight:
  • True to enable the flashlight,
  • False (default value) to avoid activating the flashlight.
iPhone/iPad Mode for managing the flashlight:
  • True to enable the flashlight,
  • False (default value) to avoid activating the flashlight.
Remarks

Use conditions

AndroidAndroid Widget In an Android application:
  • BCCapture opens a new window that displays the preview from the device camera. Then, you must:
    • center the bar code to decode in the relevant area.
    • validate like for a standard snapshot.
  • The Zxing library is used to decode bar codes (http://code.google.com/p/zxing). If this library is not found on the device, it will be automatically proposed for download. Caution: This library requires to use the landscape mode of device.
Versions 17 and later
iPhone/iPad For the iPhone/iPad applications:
  • BCCapture opens a new window that displays the preview from the device camera. Then, all you have to do is align the bar code to decode in the relevant area.
  • The window used to take the photos is included in the WINDEV Mobile application. No additional library is required. This window is always displayed in portrait mode.
  • Only the QR Code bar codes can be decoded. If another type of bar code is scanned, the decoding is not performed. The "Cancel" button found in the decoding window is used to close this window. In this case, the BarCodes variable is not initialized. Version earlier than iOS 7: Only the QR Code bar codes can be decoded. If another type of bar code is scanned, the decoding is not performed. The "Cancel" button found in the decoding window is used to close this window. In this case, the BarCodes variable is not initialized.
New in version 17
iPhone/iPad For the iPhone/iPad applications:
  • BCCapture opens a new window that displays the preview from the device camera. Then, all you have to do is align the bar code to decode in the relevant area.
  • The window used to take the photos is included in the WINDEV Mobile application. No additional library is required. This window is always displayed in portrait mode.
  • Only the QR Code bar codes can be decoded. If another type of bar code is scanned, the decoding is not performed. The "Cancel" button found in the decoding window is used to close this window. In this case, the BarCodes variable is not initialized. Version earlier than iOS 7: Only the QR Code bar codes can be decoded. If another type of bar code is scanned, the decoding is not performed. The "Cancel" button found in the decoding window is used to close this window. In this case, the BarCodes variable is not initialized.
iPhone/iPad For the iPhone/iPad applications:
  • BCCapture opens a new window that displays the preview from the device camera. Then, all you have to do is align the bar code to decode in the relevant area.
  • The window used to take the photos is included in the WINDEV Mobile application. No additional library is required. This window is always displayed in portrait mode.
  • Only the QR Code bar codes can be decoded. If another type of bar code is scanned, the decoding is not performed. The "Cancel" button found in the decoding window is used to close this window. In this case, the BarCodes variable is not initialized. Version earlier than iOS 7: Only the QR Code bar codes can be decoded. If another type of bar code is scanned, the decoding is not performed. The "Cancel" button found in the decoding window is used to close this window. In this case, the BarCodes variable is not initialized.

Managing errors

To find out whether the bar code failed to be retrieved, use the ErrorOccurred variable.
The function will fail in the following cases:
  • if it is used in the simulator,
  • if it is used in the emulator,
  • if it is used in a device not equipped with a camera.
  • Versions 17 and later
    iPhone/iPad if the "Cancel" button was used. In this case, the ..TypeBarCode property of BarCodes variable will differ from BC_QRCODE.
    New in version 17
    iPhone/iPad if the "Cancel" button was used. In this case, the ..TypeBarCode property of BarCodes variable will differ from BC_QRCODE.
    iPhone/iPad if the "Cancel" button was used. In this case, the ..TypeBarCode property of BarCodes variable will differ from BC_QRCODE.
Versions 22 and later
Android If the bar code-is decoded but if its type is not recognized, the ..TypeBarCode property of BarCodes variable will correspond to BC_UNKNOWN.
New in version 22
Android If the bar code-is decoded but if its type is not recognized, the ..TypeBarCode property of BarCodes variable will correspond to BC_UNKNOWN.
Android If the bar code-is decoded but if its type is not recognized, the ..TypeBarCode property of BarCodes variable will correspond to BC_UNKNOWN.
Related Examples:
WM Stocks Cross-platform examples (WINDEV Mobile): WM Stocks
[ + ] This application is used to perform stocktaking and to save the results in a database.
The example is used to create entries/exits in the stock, by directly scanning the bar code of products.
It is optimized to be run on tablets.
Android Inventory Android (WINDEV Mobile): Android Inventory
[ + ] This application is used to perform inventories and to save the results in a database.
Components
Android wd230android.jar
Minimum required version
  • Version 16
Comments
Click [Add] to post a comment