Paste Into

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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Paste Into

Post by richmond62 » Wed Sep 20, 2023 8:36 am

So, I have a stack [let's call it "Source"] that contains an img "fish", and I want to copy img "fish' [easily done], and then I want to past it using code into stack "TARGE" . . .

I tried this:

Code: Select all

copy img "fish"
   toplevel stack "TARGE"
   paste
and it didn't work . . .

nor did this:

Code: Select all

copy img "fish"
paste into stack "TARGE
So . . . I would be most grateful if . . . 8)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: Paste Into

Post by richmond62 » Wed Sep 20, 2023 8:39 am

Nothing quite as 'sexy' as replying to one's own postings . . . not really.

Code: Select all

copy img "fish" to stack "TARGE"

stam
Posts: 3069
Joined: Sun Jun 04, 2006 9:39 pm

Re: Paste Into

Post by stam » Wed Sep 20, 2023 9:21 am

The answer to your question is that there doesn't seem to be a 'paste into' function.

Quoth the dictionary (emphasis mine):
Use the paste command to place objects, an image, or text on the current card.

So, if you want to use Paste (although the copy method may be preferable), this works:

Code: Select all

copy img "<yourImage>"
--
go to card "<target card>" of stack "<target stack>"
paste
Also, I'm gonna guess you have multiple copies of the image "fish" at source location now ;)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: Paste Into

Post by richmond62 » Wed Sep 20, 2023 9:41 am

Also, I'm gonna guess you have multiple copies of the image "fish" at source location now
I am thinking of opening a fishmongers!

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Paste Into

Post by dunbarx » Wed Sep 20, 2023 3:54 pm

But if the target stack was made the topStack, then why did the simple "paste" not work? In other words, can a stack be made the topStack and not be, er, the topmost stack?

Craig

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

Re: Paste Into

Post by Klaus » Wed Sep 20, 2023 4:46 pm

Hi Craig,
In other words, can a stack be made the topStack and not be, er, the topmost stack?
I think you mean setting "the defaultstack". Just tested, yep, that's it! :-)

Best

Klaus

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: Paste Into

Post by richmond62 » Wed Sep 20, 2023 4:50 pm

Code: Select all

copy to stack "TARGE"
Did the trick, with nothing else 'fancier' required.

To see 'Wot I done' take a walk on the Wild Side. 8)

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Paste Into

Post by dunbarx » Wed Sep 20, 2023 7:32 pm

Klaus.

I see you solved the problem, but not explained it.

As an engineer, I a usually happy to solve a problem without understanding it. But that is not quite the case here.

The dictionary says
"Use the topStack function to find out which stack is in the current stack."
Obviously I do not understand this, and yet have solved nothing at all.

Again, the dictionary entry for "current stack":
The stack that's being worked on, usually the active window. The current stack is specified by the defaultStack property.
AHA.

So the topStack defines the current stack. And the current stack is specified by the defaultStack.

AHA I have no idea how any of this works.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: Paste Into

Post by richmond62 » Wed Sep 20, 2023 7:39 pm

The Dictionary is rarely clear on matters like this.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10045
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Paste Into

Post by FourthWorld » Wed Sep 20, 2023 7:45 pm

dunbarx wrote:
Wed Sep 20, 2023 3:54 pm
But if the target stack was made the topStack, then why did the simple "paste" not work?
One nice benefit of "copy...to..." is that it doesn't obliterate the user's clipboard contents.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Paste Into

Post by jacque » Thu Sep 21, 2023 5:38 pm

dunbarx wrote:
Wed Sep 20, 2023 7:32 pm
The dictionary says
"Use the topStack function to find out which stack is in the current stack."
Obviously I do not understand this, and yet have solved nothing at all.
That looks like a typo to me. I think it should be "which stack is the current stack."
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Paste Into

Post by dunbarx » Thu Sep 21, 2023 6:36 pm

Jacque.

That seems to me to make it slightly more worser. It more explicitly and directly states what I cannot understand.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: Paste Into

Post by richmond62 » Thu Sep 21, 2023 7:59 pm

"Slightly more worser"

What were you drinking then?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Paste Into

Post by dunbarx » Fri Sep 22, 2023 12:46 am

Drinking? What can you mean?

"Worser" is perfectly valid in both the U.S. and England. And for your information, "valid" is a scrabble term that means the word in question is in the dictionary.

So is "funner" and "funnest". My son wins money in bars betting people about those.

Craig

stam
Posts: 3069
Joined: Sun Jun 04, 2006 9:39 pm

Re: Paste Into

Post by stam » Fri Sep 22, 2023 8:24 am

While I don’t agree on playing grammar police, since you’ve responded justifying this, I’ll just add the below:
Although it may seem a logical step to move from 'worse' to 'worser', the Oxford English Dictionary does not list 'worser' as a modern English word. The Collins English Dictionary defines 'worser' as an archaic or nonstandard word for 'worse'.
Taken from: https://concisewriting.com.au/worse-wor ... r%20'worse'.

I’d have to agree with Richmond on the correctness, at least as far as UK English is concerned. But only answering you brought this up as an example of correct English because it isn’t… “worse” is already a comparator, it’s nonsensical to have a “worserer” as a comparator for the same thing. I mean you wouldn’t say “greaterer” now would you?

On the whole however I don’t agree with picking up on grammar/syntax errors. Only writing this because you tried to Justify this Craig ;)

Post Reply