Page 1 of 1

separate yes, in one button no

Posted: Sat May 03, 2014 7:30 am
by robm80
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???

Re: separate yes, in one button no

Posted: Sat May 03, 2014 7:34 am
by sefrojones
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

Re: separate yes, in one button no

Posted: Sat May 03, 2014 9:23 am
by robm80
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

Re: separate yes, in one button no

Posted: Sat May 03, 2014 9:36 am
by Simon
Hi robm80,
it works here liveCode 6.5

Simon

Re: separate yes, in one button no

Posted: Sat May 03, 2014 9:38 am
by Simon
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

Re: separate yes, in one button no

Posted: Sat May 03, 2014 2:07 pm
by robm80
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"

Re: separate yes, in one button no

Posted: Sat May 03, 2014 10:53 pm
by Simon
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

Re: separate yes, in one button no

Posted: Tue May 06, 2014 5:22 pm
by robm80
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 5674 times
WHY: I have LC 6.5.0

Re: separate yes, in one button no

Posted: Tue May 06, 2014 9:34 pm
by robm80
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