Hi,
I want to be able to check to see if a substack has already been loaded on screen so I don't reinitialise the objects. I want code something like that below from my main stack:
-- need code here to figure out if stkStack2 is already showing to the user
if bVisible then
go stack stkStack2
else
put "test" into fld fldTest of stack stkStack2
go stack stkStack2
end if
I have tried looking at the visible property of the stack stkStack2, but that is always true, whether it has been loaded on the screen or not
Any suggestions appreciated
Cheers
bergsy
Check if substack is already loaded
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Check if substack is already loaded
Hi bergsy,
Check out "openStacks" in the dictionary.
Simon
Check out "openStacks" in the dictionary.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
FourthWorld
- VIP Livecode Opensource Backer

- Posts: 10066
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Check if substack is already loaded
You could also set a flag in a global, something like gInited - check it during init and if empty run your setup and then set it to true.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Check if substack is already loaded
Hi Simon,
Works great - I just check for the stack name in all the open stacks
Cheers
Bergsy
Works great - I just check for the stack name in all the open stacks
Cheers
Bergsy
Re: Check if substack is already loaded
Hi Bergsy,
little background info:
When you open a stack (file from disk), then this stack and ALL its substacks, if any, are loaded into RAM.
So your substack has in fact already been loaded and you wanted to check if is is OPEN already.
Best
Klaus
little background info:
When you open a stack (file from disk), then this stack and ALL its substacks, if any, are loaded into RAM.
So your substack has in fact already been loaded and you wanted to check if is is OPEN already.
Best
Klaus