Getting information from a different stack

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
exheusden
Posts: 170
Joined: Fri Oct 09, 2009 5:03 pm
Contact:

Getting information from a different stack

Post by exheusden » Wed Oct 28, 2009 7:07 pm

I have the following lines of code:

Code: Select all

go invisible stack "/Users/davidneale/Documents/Revolution/Web Preferences"
   put fld "Content" of cd "search" of stack "Web Preferences" into searchInit
(and I've tried this without the "invisible" modifier, too)

This returns the error:
execution error at line 20 (Chunk: can't find stack), char 4
which points to the "put fld" line in the above code.

If I open the stack "Web Preferences" (by using the "Open Stack…" menu command, for example), then the script works fine.

How can I gain access to the stack from another stack's script, without having to open it first?

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4171
Joined: Sun Jan 07, 2007 9:12 pm

Post by bn » Wed Oct 28, 2009 7:31 pm

David,
Web Preferences"
it looks like you omitted the ".rev" part
try

Code: Select all

go invisible stack "/Users/davidneale/Documents/Revolution/Web Preferences.rev"
regards
Bernd

exheusden
Posts: 170
Joined: Fri Oct 09, 2009 5:03 pm
Contact:

Post by exheusden » Wed Oct 28, 2009 7:36 pm

Yes, I did. I honestly didn't think that was necessary. I must stop making assumptions!

Thank you.

Klaus
Posts: 14190
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Thu Oct 29, 2009 9:37 am

You don't even need to "go to stack xyz", invisible or not:
...
put fld "Content" of cd "search" of stack "/Users/davidneale/Documents/Revolution/Web Preferences.rev" into searchInit
...
will do :-)


Best

Klaus

exheusden
Posts: 170
Joined: Fri Oct 09, 2009 5:03 pm
Contact:

Post by exheusden » Thu Oct 29, 2009 10:28 am

Thanks Klaus.

In this case, however, I have many other items I wish to get from the second stack, so there's a whole series of puts, so it's easier to do a single go. (Unless there's yet another way that I don't know of, of course.)

Post Reply