Send variable from one card to another card?

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

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: Send variable from one card to another card?

Post by BvG » Mon May 30, 2011 1:25 am

he meant you can't go to the same stack that you're currently showing, making it show paralell in a second window. it's one stack per window. however, you can easily make a second stack, and then use that as your edit mask, no?
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

jesse
Posts: 205
Joined: Thu Nov 11, 2010 6:32 pm

Re: Send variable from one card to another card?

Post by jesse » Mon May 30, 2011 3:32 am

BvG,

How would I send the variable CurrentID from the one stack where my datagrid is to a new stack for the "Edit Window"?

Code: Select all

go to stack "Edit Card" CurrentID
??
Deving on WinVista Home Prem. SP2 32 bit. Using LiveCode 4.6.1 Pro Build 1392

jesse
Posts: 205
Joined: Thu Nov 11, 2010 6:32 pm

Re: Send variable from one card to another card?

Post by jesse » Mon May 30, 2011 5:03 am

Nevermind I think I got it. TO simple I just created a sub stack and then call the global variable into a field like this.
I actually changed to theDataA as the variable which is the array of columns for from the row selected in the datagrid.
Then it simply preloads the Name of the product into a field productName.

Code: Select all

on preOpenStack
global theDataA
answer  theDataA["ID"]
put theDataA["Name"] into the field "productName"
end preOpenStack
I assume this is the correct method.
Deving on WinVista Home Prem. SP2 32 bit. Using LiveCode 4.6.1 Pro Build 1392

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

Re: Send variable from one card to another card?

Post by Klaus » Mon May 30, 2011 12:29 pm

Hi Jesse,

yes, this is the correct way to go!

A "global" variable is "visible" in ALL cards of all stacks and substacks
that you open in your current LiveCode session!


Best

Klaus

jesse
Posts: 205
Joined: Thu Nov 11, 2010 6:32 pm

Re: Send variable from one card to another card?

Post by jesse » Thu Jun 02, 2011 2:22 am

Thanks Klaus!
Deving on WinVista Home Prem. SP2 32 bit. Using LiveCode 4.6.1 Pro Build 1392

Post Reply