How to access the text content of a substack w/o opening
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 10
- Joined: Fri Nov 16, 2018 2:01 am
How to access the text content of a substack w/o opening
Hi all,
Using LC 9.0.1 Community on an i7 Windows 10 machine with 16Gb ram.
So, I have a substack called "AboutUsStack". In the substack is a text field labeled "aboutustext" on a card labeled "AboutUsCard". I'm trying to place the text of the card in the substack into a field on the main stack, without showing the substack. Here's my script that isn't working:
go invisible stack "AboutUsStack"
put field "aboutustext" of card "AboutUsCard" into field "capture"
I have also tried the much longer version: put field "aboutustext" of card "AboutUsCard" of stack "AboutUsStack" into field "capture" --doesn't work.
And yes, the Property of the substack is set to the Main Stack.
Surely it's possible to access the text of a substack without showing it on screen, yes?
Thanks for your help,
John
Using LC 9.0.1 Community on an i7 Windows 10 machine with 16Gb ram.
So, I have a substack called "AboutUsStack". In the substack is a text field labeled "aboutustext" on a card labeled "AboutUsCard". I'm trying to place the text of the card in the substack into a field on the main stack, without showing the substack. Here's my script that isn't working:
go invisible stack "AboutUsStack"
put field "aboutustext" of card "AboutUsCard" into field "capture"
I have also tried the much longer version: put field "aboutustext" of card "AboutUsCard" of stack "AboutUsStack" into field "capture" --doesn't work.
And yes, the Property of the substack is set to the Main Stack.
Surely it's possible to access the text of a substack without showing it on screen, yes?
Thanks for your help,
John
Re: How to access the text content of a substack w/o opening
Hi John,
hm, this definitively works in my little test!
Button in mainstack, "sss" is the closed substack:
Best
Klaus
hm, this definitively works in my little test!
Button in mainstack, "sss" is the closed substack:
Code: Select all
on mouseUp
put fld "feld" of cd 1 of stack "sss" into fld "mainstackfield"
end mouseUp
Klaus
Re: How to access the text content of a substack w/o opening
Well, he was almost there, he just didn't need the go partTooManyNotes wrote: ↑Sat Dec 01, 2018 2:57 pmput field "aboutustext" of card "AboutUsCard" into field "capture"
I wonder though, since the go part shouldn't have killed what he was trying for if this wasn't part of the bug that recently resurfaced about a failure in the startCenter
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: How to access the text content of a substack w/o opening
@Bogs.
When he went to the substack, he lost his way back to the mainStack. The field reference in the mainStack was broken; he was no longer there. He could have made explicit reference, though.
@John. You can reference any control in any open stack just by asking. And know that a subStack is opened automatically once its mainStack opens. So in general, from anywhere at all, you can:
You do not need to "be" anywhere at all.
Craig Newman
When he went to the substack, he lost his way back to the mainStack. The field reference in the mainStack was broken; he was no longer there. He could have made explicit reference, though.
@John. You can reference any control in any open stack just by asking. And know that a subStack is opened automatically once its mainStack opens. So in general, from anywhere at all, you can:
Code: Select all
put anyThingAtAll into anyPlaceAtAll on card anyCard of stack anyOpenStack
Craig Newman
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: How to access the text content of a substack w/o opening
Any property of any object of any stack file can be read or written to at any time, without the need to explicitly open the stack with "go" or "open".
When accessed without explicitly opening, the stack file is temporarily read into memory, where it may remain until that memory is needed by other objects.
Be sure to use the "save" command if you want any changes to an object to remain between sessions. And given that stacks not explicitly opened may be purged from memory at any time, you'll want to use that save command soon after the property change.
When accessed without explicitly opening, the stack file is temporarily read into memory, where it may remain until that memory is needed by other objects.
Be sure to use the "save" command if you want any changes to an object to remain between sessions. And given that stacks not explicitly opened may be purged from memory at any time, you'll want to use that save command soon after the property change.
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