Hi,
I want to pass values from one card to another ,both card are under same stack.
in my first card i am taking line number and according to that fetching value,value is a html,plz chi below
In my first card :
put "item_" & word 2 of the selectedLine of me into theLine
put the customproperties[theLine] of this stack into theItem
Now i want to use this fetched value in my next card but unable to do by using global variable.
Want top pass values from one card to another
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 19
- Joined: Fri Dec 13, 2013 6:15 am
-
- VIP Livecode Opensource Backer
- Posts: 296
- Joined: Wed May 02, 2012 12:23 pm
- Location: New York
- Contact:
Re: WANT TO PASS VALUES FROM ONE CARD TO ANOTHER
Monika hi,
There are many ways to do this, using a global is the least preferable one.
I'll write two of them on top of my head.
1.
Use a custom property.
Script for card 1:
Script for card 2:
2.
Using getter - setter method.
Script for card 1:
Script for card 2:
Edit:
Btw, if you still wanna use global variables, you should know that you have to define them in each script where you want to use them.
Script for card 1:
Script for card 2:
Hope it helps...
Best,
~ Ender Nafi
There are many ways to do this, using a global is the least preferable one.
I'll write two of them on top of my head.
1.
Use a custom property.
Script for card 1:
Code: Select all
on fetchData
put "item_" & word 2 of the selectedLine of me into theLine
put the customProperties[theLine] of this stack into theItem
set the cPassingParam of card 2 to theItem
end fetchData
Code: Select all
on doThing
put the cPassingParam of me into tParam
if tParam is not empty then...
end doThing
Using getter - setter method.
Script for card 1:
Code: Select all
on fetchData
put "item_" & word 2 of the selectedLine of me into theLine
put the customProperties[theLine] of this stack into theItem
send "writeParams theItem" to card 2 in 1 milliseconds
end fetchData
Code: Select all
local sPassingParam
on writeParams tParam
put tParam into sPassingParam
end writeParams
on doThing
if sPassingParam is not empty then...
end doThing
Btw, if you still wanna use global variables, you should know that you have to define them in each script where you want to use them.
Script for card 1:
Code: Select all
global gPassingParam
on fetchData
put "item_" & word 2 of the selectedLine of me into theLine
put the customProperties[theLine] of this stack into theItem
put theItem into gPassingParam
end fetchData
Code: Select all
global gPassingParam
on doThing
if gPassingParam is not empty then...
end doThing
Best,
~ Ender Nafi
~... together, we're smarter ...~
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
-
- Posts: 19
- Joined: Fri Dec 13, 2013 6:15 am
Re: WANT TO PASS VALUES FROM ONE CARD TO ANOTHER
thanks 1st method working fine.
-
- Posts: 19
- Joined: Fri Dec 13, 2013 6:15 am
Re: Want top pass values from one card to another
Hi Ender are you abel to help me in order to show image from url on card?