Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 10.1   10.2   10.3   10.4   10.5   11.0   11.1   11.2   11.3   11.4    Statistic    FMM    Blog  

Barcode.LoadLibrary

Loads the zbar library.

Component Version macOS Windows Linux Server iOS SDK
Barcode 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Barcode.LoadLibrary"; Path )   More

Parameters

Parameter Description Example
Path Native file path to the library.
A dylib on macOS, a DLL file on Windows and a shard object on Linux wiht so extension.
"/tmp/libzbar.so.0"

Result

Returns OK or error.

Description

Loads the zbar library.
Our Barcode.Scan function uses the open source zbar library. Since this library is licensed under LGPL, we can't embed it within the plugin, but you can ship it with your solution, either as a file you install with the plugin or as a file you store in a container and then export to a temp folder.

We have libraries for you here:
https://www.monkeybreadsoftware.com/filemaker/files/Libs/

Examples

Load the zbar library on macOS:

MBS( "Barcode.LoadLibrary"; "/Users/cs/Desktop/zbar/libzbar.0.dylib" )

Load the zbar library on Linux:

MBS( "Barcode.LoadLibrary"; "/usr/lib/x86_64-linux-gnu/libzbar.so.0" )

// needs to install package on Linux:
// sudo apt-get install libzbar0

Load on various operation systems:

If [ MBS("IsWindows") ]
    # you may need to download zbar from our Libs folder or get your own
    # our copy of the library has a dependency, so we load libiconv first
    Set Variable [ $path ; Value: "C:\Users\Christian\Desktop\libiconv.dll" ]
    Set Variable [ $r ; Value: MBS( "Process.LoadLibrary"; $Path ) ]
    # now we can load zbar dll
    Set Variable [ $path ; Value: "C:\Users\Christian\Desktop\libzbar64-0.dll" ]
Else If [ MBS("isMacOS") ]
    # you may need to download zbar from our Libs folder or get your own
    Set Variable [ $path ; Value: "/Users/cs/Desktop/zbar/libzbar.0.dylib" ]
Else If [ MBS("isLinux") ]
    # you may need to install first: sudo apt-get install libzbar0
    Set Variable [ $path ; Value: "/usr/lib/x86_64-linux-gnu/libzbar.so.0" ]
Else
    Show Custom Dialog [ "Unsupported platform" ; "No library coded for this platform or no MBS Plugin installed." ]
    Halt Script
End If
#
# load zbar
Set Variable [ $r ; Value: MBS("Barcode.LoadLibrary"; $path) ]
If [ MBS("IsError") ]
    Show Custom Dialog [ "Failed to load library" ; $r ]
End If

See also

Release notes

Example Databases

Blog Entries

Created 23th May 2021, last changed 2nd July 2021


Barcode.LibVersion - Barcode.Loaded

Feedback: Report problem or ask question.




Links
MBS Xojo Chart Plugins

Start Chat