Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Sets a static field on a class.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Java | 6.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
Parameter | Description | Example |
---|---|---|
ClassName | The name of the java class. | "com.mbs.test" |
FieldName | The name of the field. | "test" |
Signature | The java signature of the field. This describes the data type of the field. |
"I" |
Value | The value to use for the field. | 123 |
Returns OK or error.
Test static field:
Set Variable [$r; Value:MBS( "Java.SetStaticField"; "test"; "n"; "I"; 3456)]
Set Variable [$r; Value:MBS( "Java.GetStaticField"; "test"; "n"; "I")]
Show Custom Dialog ["value"; $r]
Set various static fields:
Set Variable [$r; Value:MBS( "Java.SetStaticField"; "tests"; "static_property_boolean"; "Z"; 1)]
Set Variable [$r; Value:MBS( "Java.SetStaticField"; "tests"; "static_property_byte"; "B"; 123)]
Set Variable [$r; Value:MBS( "Java.SetStaticField"; "tests"; "static_property_byteArray"; "[B"; Java Test::TestContainer)]
Set Variable [$r; Value:MBS( "Java.SetStaticField"; "tests"; "static_property_char"; "C"; 123)]
Set Variable [$r; Value:MBS( "Java.SetStaticField"; "tests"; "static_property_charArray"; "[C"; "123")]
Set Variable [$r; Value:MBS( "Java.SetStaticField"; "tests"; "static_property_double"; "D"; 123)]
Set Variable [$r; Value:MBS( "Java.SetStaticField"; "tests"; "static_property_float"; "F"; 123)]
Set Variable [$r; Value:MBS( "Java.SetStaticField"; "tests"; "static_property_int"; "I"; 123)]
Set Variable [$r; Value:MBS( "Java.SetStaticField"; "tests"; "static_property_long"; "J"; 123)]
Set Variable [$r; Value:MBS( "Java.SetStaticField"; "tests"; "static_property_short"; "S"; 123)]
Set Variable [$r; Value:MBS( "Java.SetStaticField"; "tests"; "static_property_string"; "Ljava/lang/String;"; "123")]
This function checks for a license.
Created 2nd October 2016, last changed 18th October 2016