separate yes, in one button no

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
robm80
Posts: 161
Joined: Sat May 03, 2014 7:15 am

separate yes, in one button no

Post by robm80 » Sat May 03, 2014 7:30 am

In button "try" I put this script:
on mouseUp
create card "mies"
set the backgroundcolor of card "mies" to red
copy field "inhoud" to card "mies"
copy group "velden" to card "mies"
copy button "terug" to card "mies"
end mouseUp

It completes line 1 and 2, but no more

In button copy I put the rest of this scipt"
on mouseUp
copy group "velden" to card "mies"
copy button "terug" to card "mies"
copy field "inhoud" to card "mies"

end mouseUp

so in one button NO in 2 buttons YES

WHY NOT IN 1 BUTTON ? What's wrong???

sefrojones
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 447
Joined: Mon Jan 23, 2012 12:46 pm

Re: separate yes, in one button no

Post by sefrojones » Sat May 03, 2014 7:34 am

Try specifying what card the objects to be copied are on, like this :

Code: Select all

on mouseUp
create card "mies"
set the backgroundcolor of card "mies" to red
copy field "inhoud" of cd "yourcardhere" to card "mies"
copy group "velden" of cd "yourcardhere" to card "mies"
copy button "terug" of cd "yourcardhere" to card "mies"
end mouseUp
That might help!

--sefro

Edit:

Explanation: when you "create card" you go directly to the card you just created, so when you try to copy the objects you need to specify what card they are on.
check out create card and backgroundBehavior in the dictionary

robm80
Posts: 161
Joined: Sat May 03, 2014 7:15 am

Re: separate yes, in one button no

Post by robm80 » Sat May 03, 2014 9:23 am

Sefro,

I translated your example as:
on mouseUp
create card "mies"
set the backgroundcolor of card "mies" to red
copy field "inhoud" of cd "PK" to card "mies"
copy group "velden" of cd "PK" to card "mies"
copy button "terug" of cd "PK" to card "mies"
end mouseUp


but very sorry: it does not work !
Like with me: a red card "MIES" is created, but empty...

Next question:
How can I add a line to the content of field "inhoud" of card "PK" BY SCRIPT

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: separate yes, in one button no

Post by Simon » Sat May 03, 2014 9:36 am

Hi robm80,
it works here liveCode 6.5

Simon
Attachments
robm80.zip
LC 6.5
(792 Bytes) Downloaded 213 times
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: separate yes, in one button no

Post by Simon » Sat May 03, 2014 9:38 am

How can I add a line to the content of field "inhoud" of card "PK" BY SCRIPT

Code: Select all

put "here I am" into fld "inhound"
If you are on card PK
Study this if you are not:
http://lessons.runrev.com/s/lessons/m/4 ... ssage-path

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

robm80
Posts: 161
Joined: Sat May 03, 2014 7:15 am

Re: separate yes, in one button no

Post by robm80 » Sat May 03, 2014 2:07 pm

it works here liveCode 6.5
I also have 6.5, but here it does not work ???
How can I add a line to the content of field "inhoud" of card "PK" BY SCRIPT
This is my script and it is OK
put crlf & "Gijs" after fld "inhoud"

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: separate yes, in one button no

Post by Simon » Sat May 03, 2014 10:53 pm

Hi robm80,
I also have 6.5, but here it does not work ???
Are you saying the stack I posted is not working?
The whole thing or just part?
Is there an error message?

Need more than "doesn't work" as using your exact script works fine here.
You will need more post (10 I think) before you can post a stack so if you have a dropbox account post your stack there.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

robm80
Posts: 161
Joined: Sat May 03, 2014 7:15 am

Re: separate yes, in one button no

Post by robm80 » Tue May 06, 2014 5:22 pm

Up till now, my first step in LC was succesfull, but now I meet an abnormality I cannot understand:
When I create a new card by: create card or create card "foo" or what else , I get a black card looking like this:
sshot-6a.jpg
smal part of the card
sshot-6a.jpg (22.64 KiB) Viewed 5675 times
WHY: I have LC 6.5.0

robm80
Posts: 161
Joined: Sat May 03, 2014 7:15 am

Re: separate yes, in one button no

Post by robm80 » Tue May 06, 2014 9:34 pm

Forget last posting: solution is: set backgroundcolor of this card to white.

But I have a real problem:
I have created a card called "foo"
A line in the scrolling list field "mycontent" is also "foo" and this line is selected!
In the messagebox I write "go to card "foo" and card "foo" is present.
Now I write in the messagebox: go to card (selectedtext of field "mycontent") and the answer is "no such card".
And this while in another try it worked perfectly.
Is there anyone who can explain this to me?

Thanks
Rob

Post Reply