Hi all,
Is this the right way to define two (2) persistent variables?
// Check if nv table exists and if it contains the keys 'count' and 'flag'
if (!("nv" in getroottable()) || !("count" in nv) || !("flag" in nv)) {
// Either the nv table hasn't been instantiated or it has but lacks a 'count' slot or a 'flag' slot
// So create them. If nv table exists, this code just adds 'count' or 'flag' to it. If nv
// doesn't exist yet, this code will automatically create it when it adds 'count' and 'flag'
nv <- { "count": 0 };
nv.flag <- 0;
}
if I do this instead, I get a run time error:
nv <- { “count”: 0 };
nv <- { “flag”: 0 };
Thanks!