Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4    Statistic  

XL.Initialize

Initializes the XL library by loading it.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
XL 2.9 Yes Yes Yes Yes Yes

MBS( "XL.Initialize"; LibPath; LicenseName; LicenseKey )

Parameters

Parameter Description Example value
LibPath Native path to the DLL on Windows or Dylib file on Mac OS X. "C:\libxl\libxl.dll"
LicenseName The name of your libXL license. ""
LicenseKey The license key of your libXL license. ""

Result

Returns OK on success.

Description

Initializes the XL library by loading it.
You can keep the library in a database field and export it at runtime to a known location and load it from there.
If you have no license yet, you can test this function by passing empty strings for name and key.

For getting a license key, please visit the libXL website:
https://www.bluesnap.com/jsp/redirect.jsp?contractId=2284940&referrer=983554

Starting with version 4.4, you can pass just the filename of library and the plugin finds it in the Extensions folder or in FileMaker's application folder.

Windows error 193 means that 64-bit FileMaker tried to load 32-bit library or 32-bit FileMaker tried to load 64-bit library. The bit level must match between app and library. For Mac OS X the error message will tell you about wrong architecture.

This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.

Examples

Initialize XL:

MBS( "XL.Initialize"; "/Library/FileMaker Server/Extensions/libxl.dylib"; "Test User"; "mac-43567890..." )

Initialize when needed:

#Initialize XL
If [MBS( "XL.IsInitialized" ) ≠ 1]
    If [Get ( SystemPlatform ) = -3]
        # iOS
        Exit Script []
    Else If [Get ( SystemPlatform ) = -2]
        # Windows
        Set Variable [$path; Value: "libxl.dll"]
        Set Variable [$key; Value: "win-32213..."]
    Else
        # Mac
        Set Variable [$path; Value: "libxl.dylib"]
        Set Variable [$key; Value: "mac-32213..."]
    End If
    Set Variable [$r; Value: MBS( "XL.Initialize"; $path; "test"; $key )]
    If [$r ≠ "OK"]
        Show Custom Dialog [ "LibXL failed to initialize"; $r]
    End If
End If

See also

Example Databases


XL.Format.SetWrap   -   XL.IsInitialized

Feedback: Report problem or ask question.




Links
MBS Xojo PDF Plugins