MyChat Scripts Engine: JSONSetBoolean, setting the boolean value in a JSON object
Creating or changing the Boolean value of a JSON object.
Syntax
function JSONSetBoolean(var sJSON, sKey: string; bValue: boolean): integer;
Parameters and return values
Parameter |
Type |
Value |
var sJSON |
var string |
JSON object as a text string; |
sKey |
string |
required key name; |
bValue |
boolean |
key value. |
Function result
0 |
no errors; |
1 |
JSON parsing error. |
Example
var
s: string;
x: integer;
begin
s := '{"Alexander" : true, "Clarissa" : false}';
x := JSONSetBoolean(s, 'Alexander', false);
mLogScript('JSON: ' + s, 'TEST');
end.
Script work result
[19:00:59] (Log "test"): [TEST] JSON: {"Alexander":false,"Clarissa":false}
See also
Created with the Personal Edition of HelpNDoc: Bring your WinHelp HLP help files into the present with HelpNDoc's easy CHM conversion