RemoveMember

RemoveMember 1:

This method deletes the property at the current iterator.

Syntax

METHOD RemoveMember : BOOL
VAR_INPUT
  v : SJsonValue;
  i : SJsonIterator;
  keepOrder : BOOL;
END_VAR

RemoveMember 2: Return value

Name

Type

RemoveMember

BOOL

RemoveMember 3: Inputs

Name

Type

v

SJsonValue (note possible invalidity)

i

SJsonIterator

keepOrder

BOOL

Sample call:

The following JSON document is to be loaded into the DOM memory:


sMessage := '{"serialNumber":"123","batteryVoltage":"1547mV","clickType":"SINGLE", "array":["Hello",2,3]}';

The "array" property is to be deleted. First of all, the JSON document is searched for the "array" property, after which the property is removed.

jsonDoc         := fbJson.ParseDocument(sMessage);
jsonIterator    := fbJson.MemberBegin(jsonDoc);
jsonIteratorEnd := fbJson.MemberEnd(jsonDoc);
WHILE jsonIterator <> jsonIteratorEnd DO
  sName         := fbJson.GetMemberName(jsonIterator);
  IF sName = 'array' THEN
    fbJson.RemoveMember(jsonDoc, jsonIterator);
  END_IF
  jsonIterator  := fbJson.NextMember(jsonIterator);
END_WHILE