MyChat Scripts Engine: JSONSetInteger, set an integer in a JSON object
Create or edit an integer of a JSON object key
Syntax
function JSONSetInteger(var sJSON: string; sKey: string; iValue: integer): integer;
Parameters and return values
Parameter |
Type |
Value |
sJSON |
var string |
JSON object as a text string; |
sKey |
string |
required key name; |
iValue |
integer |
key value. |
Function result
0 |
no errors; |
1 |
JSON parsing error. |
Example
var
s: string;
begin
s := '{}';
JSONSetInteger(s, 'Apple', 5);
mLogScript('JSON object: ' + s, 'TEST');
end.
Script work result
[18:30:06] (Log "test"): [TEST] JSON object: {"Apple":5}
See also
Created with the Personal Edition of HelpNDoc: Effortlessly Create Professional Documentation with HelpNDoc's Clean UI