By the way, never rely on the formatting of things returned from toString() calls. That formatting is for human use / debugging use. I'll explain the formatting of Scope's toString for you:
If it reads like this: [Slide @ 750049004: 69]->[IndexVars @ 1773554974: 3]->[FolderVars @ 710258153: 23]->[Globals @ 1477797353: 57]
This is interpreted as one "Slide" scope containing 69 variables. Its parent is an "IndexVars" scope containing 3 variables. Its parent is a "FolderVars" scope containing 23 variables and its parent is the "Globals" scope containing 57 variables. The @ <number> indicates the equivalent of a memory location so you can tell various instances apart even if they contain the same data. If the same variable occurs in both an outer and inner scope, then you'll get the innermost one when querying the scope instance for it. The Scope mechanism is designed to mimic how variables in a computer language can occur in inner and outer scopes, where the inner scope "hides" the corresponding variables in the outer scope. See this pseudo code:
String name="David";
print name; // Prints David
{ // Local scope introduced here
String name = "Anders";
print name; // prints "Anders"
}
print name; // Prints David again
Edited by: JeffTucker on 25 Jan 2022, 14:00, to fix formatting