Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
XL.IsInitialized
Checks if libXL library has been initialized.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
XL | 4.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
none
Result
Returns 1 or 0.
Description
Checks if libXL library has been initialized.If value is 1, everything is okay.
If value is zero, the library is not initialized and you need to call XL.Initialize function.
On a hosted database this function is better than using a global variable, as the variable can't see if initialization was made on server or client side.
Examples
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
Register LibXL for MBS Plugin
If [ MBS("XL.IsInitialized") ≠ 1 ]
If [ MBS("IsMacOS") ]
Set Variable [ $r; Value: MBS( "XL.Initialize"; $path; "xxx"; "mac-xxx" )]
Else If [ MBS("IsWindows") ]
Set Variable [ $r; Value: MBS( "XL.Initialize"; $path; "xxx"; "win-xxx" )]
Else If [ MBS("IsLinux") ]
Set Variable [ $r; Value: MBS( "XL.Initialize"; $path; "xxx"; "linux-xxx" )]
Else If [ MBS("IsIOS") ]
Set Variable [ $r; Value: MBS( "XL.Initialize"; $path; "xxx"; "ios-xxx" )]
Else
Set Variable [ $r; Value: "new platform?" ]
End If
If [$r ≠ "OK"]
Show Custom Dialog ["Problem with LibXL Registration"; $r]
End If
End If
See also
- IsIOS
- IsLinux
- IsMacOS
- IsWindows
- TAPI.IsInitialized
- XL.Book.DeleteSheet
- XL.Book.SaveToFile
- XL.Initialize
- XL.LoadBook
- XL.Uninitialize
Example Databases
- XL/AutoFilter
- XL/Change Column Names
- XL/Conditional Formatting
- XL/Converter
- XL/Edit Sheet
- XL/Export records
- XL/Sheet with colored text
- XL/Writing data
- XL/XL Test
Blog Entries
- MBS Plugin Advent calendar: 13 - XL
- Tips and tricks with MBS
- Read And Write Excel Files With FileMaker
- New column names in an Excel document
- How to use XL functions with MBS FileMaker Plugin
- MBS Filemaker Plugin, version 4.2pr6
FileMaker Magazin
This function is free to use.
Created 18th August 2014, last changed 29th January 2023