Name Unresolved Error: Name Unresolved: lf in access or evaluation of 'lf' , lf
Jul 6, 2018 2:20 AM(1238 views)
I have a variable called lf, (lf = ListF << Get Items, where ListF is a list of items). I define ListF within a function that contains a button box. In the function for that button box, which is defined after the function where ListF is defined, I set lf = ListF << GetItems. I can access the lf variable inside the functions but after the functions, when I write print(lf); it gives me this name unresolved error. Could you give me an idea as to why?
Variable scope *might* be the issue. "lf" seems to be created and assigned a value inside of the eval chunk of code: a local variable. When that chunk of code is complete, garbage collection deletes the local variable.
Define "lf" and assign it a bogus value early so it becomes global. Then when are running the eval later, it won't define a local "lf" but a global "lf" that then the eval updates.