The DRecord
class now supports indexing into StrArray
.
When calling a DRecord
method that takes the path to a StrArray variable, an additional indexing operator ";;" can now be specified, followed with an integer, to access the value stored at that index.
DRecord root(); root.assign("test.var", StrArray(["one", "two"])); pln(root.lookupStr("test.var;;1")); // output: two
As a result of this change, the substring ";;" can no longer appear in any part of the path to the variable, and can only appear when accessing a StrArray.
DRecord root(); root.assign("test.var;;1", null); // not allowed root.assign("test.v;;ar", 3); // not allowed