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:
9.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
Statistic
FMM
Blog
Calls a static method on a class.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Java | 6.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
Parameter | Description | Example | Flags |
---|---|---|---|
ClassName | The name of the java class. | "com.mbs.test" | |
MethodName | The name of the method. | "test" | |
Signature | The java signature of the method. This describes the parameter types. Please use "javap -s test.class" with file path to class file to show the signatures for a class. |
"[]" | |
Params | The parameters to pass. Pass one parameter in FileMaker for each parameter to pass. |
Optional |
Returns result or error.
Call Function GetString:
MBS( "Java.CallStaticMethod"; "test"; "GetString"; "()Ljava/lang/String;" )
Call function returning an integer:
// public static int method_int(int a, double b, char c, long d, short e)
Set Variable [$r; Value:MBS( "Java.CallStaticMethod"; "tests"; "method_int"; "(IDCJS)I"; 10000; 2000; 300; 40; 5 )]
If [MBS("IsError") or ($r ≠ 12345)]
Show Custom Dialog ["Java Error"; $r]
Exit Script [Result: "Static int method failed"]
End If
Call function returning a double value:
// public static double method_double(int a, double b, char c, long d, short e)
Set Variable [$r; Value:MBS( "Java.CallStaticMethod"; "tests"; "method_double"; "(IDCJS)D"; 10000; 2000; 300; 40; 5 )]
If [MBS("IsError") or ($r ≠ 12345)]
Show Custom Dialog ["Java Error"; $r]
Exit Script [Result: "Static double method failed"]
End If
Created 2nd October 2016, last changed 22nd November 2018
Java.CallObjectMethod - Java.DefineClass
Feedback: Report problem or ask question.