Page 1 of 1

Copy a card to another

Posted: Fri Apr 09, 2010 12:50 pm
by bsouthuk
Hello again.

I have another question and wonder if someone can point me in the right direction.

I have built a quote generating application and when selections are made within my application a user is able to generate a 'sales proposal'.

I am now looking to implement a feature where if a user was to add information on a specific card to the end of the 14 card proposal then all they have to do is click a button. This is pretty straight forward but I am stuck when it comes to if a user wants to add more than 1 card to the end of 14 card proposal.

Any ideas on a simple script that copies info on 1 card to the end of a 14 card proposal? And obviously if more than 1 card needs to be copied it will check if page 15 has any info on there and if so then to copy to page 16 and so on.

Hope this makes sense.

Cheers

Dan

Re: Copy a card to another

Posted: Fri Apr 09, 2010 4:06 pm
by Mark
Hi Dan,

What you want seems to be similar to

Code: Select all

put fld "Original Text" of cd 1 into fld "Copied Text" of cd 16
Best,

Mark

Re: Copy a card to another

Posted: Fri Apr 09, 2010 4:18 pm
by bsouthuk
Thanks Mark

Yes that's right, however say if the user has already copied a card into card 16. How can I script it so that it will then be copied to card 17. And if card 17 has already had a card copied to it then into card 18 and so on?

Re: Copy a card to another

Posted: Fri Apr 09, 2010 4:32 pm
by Mark
I'm not sure, Dan, but perhaps you could check whether fields are empty:

Code: Select all

repeat with x = 1 to number of cards
  if fld "Field to check" is empty then exit repeat
end repeat
put fld "Original Text" of cd 1 into fld "Copied Text" of cd x
Or you could always create a new card before copying:

Code: Select all

go last cd
create card
put fld "Original Text" of cd 1 into fld "Copied Text" of last cd
Best,

Mark

Re: Copy a card to another

Posted: Fri Apr 09, 2010 7:14 pm
by bsouthuk
Thats perfect Mark thank you - all sorted.

Your help was most appreciated!