Need to move data from one stack to another??????????

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
no1g8tor
Posts: 62
Joined: Fri Nov 23, 2007 3:01 pm

Need to move data from one stack to another??????????

Post by no1g8tor » Wed Oct 01, 2008 3:37 pm

Thanks in advance for your help.

I need to move data from my "Printout" stack to my "OnScreenView" stack and need it to be in a scrolling field.

OK...wtith that said, let me explain.

I have a "report" stack that has anywhere from 10 to 20 cards that contain the information for the customer. These stacks are only about 3 inches high and when the customer clicks print it puts three cards at a time on a page for the report.

Right now I have no way of viewing on screen, only printer. I need it to be in a field because I am going to have another field on the same card with other info they need to see that is pulled from the web for comparison. (two scrolling fields on top of each other.)

I want to be able to put each "report" card in the scrolling filed one on top of the other with a little space in between each. I would guess the best way is in a scrolling field.

I also need it to stay in the EXACT format.

Is there a way to just "Copy" and "Paste" it into a scrolling field or What would be the best way.

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Contact:

Post by malte » Wed Oct 01, 2008 3:52 pm

Hi,

I think the best way is to script that. Do you have the data in one or many fields on your printout stack? Withou seeing how it is set up, it is difficult to script a solution. Given it is only one field on each card it might look something like this:

local tList
repeat with i=1 to the number of cards of stack "printOut"
put field "textField" of cd i of stack "printOut" & cr after tlist
end repeat
put tList into fld "scrollingField" of stack "otherStack"

Hope that gets you started,

Malte

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Contact:

Post by malte » Wed Oct 01, 2008 3:54 pm

Forgot to mention: With my previous script the text formatting is lost.
If you need to maintain formatting, you might wish to use the HTMLText property.

Cheers,

malte

no1g8tor
Posts: 62
Joined: Fri Nov 23, 2007 3:01 pm

Post by no1g8tor » Wed Oct 01, 2008 4:23 pm

Malte,

Thanks for the reply but It about 20 fields each in a specific location to create the printout.

What about gouping the objects? Could I just copy and pate it as a goup. I thought up ways to scitpt it that would work, but there should be a way to just move the data easily.

Thanks

no1g8tor
Posts: 62
Joined: Fri Nov 23, 2007 3:01 pm

Post by no1g8tor » Wed Oct 01, 2008 4:42 pm

sorry about my spelling and grammer. I am at work and have to do this fast...lol.

Grouping the objects

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Wed Oct 01, 2008 9:01 pm

You could assemble the data in the scrolling list field like this:

Code: Select all

on mouseUp
  put the htmlText of field "foo" into tHtmlText
  put return & "<p></p>" & return after tHtmlText
  put the htmlText of field "bar" after tHtmlText
  set the htmlText fo field "Report" to tHtmlText
  revPrintField the long ID of field "Report"
end mouseUp
Hope this helped,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

no1g8tor
Posts: 62
Joined: Fri Nov 23, 2007 3:01 pm

Post by no1g8tor » Thu Oct 02, 2008 12:37 am

I am sorry, but I have no clue what this code is???

I have 20 Fields on each card and would need to move them in there exact position. It is a layout.

I really appreciate your help.

Thanks

Mike

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Thu Oct 02, 2008 11:02 am

it's code to copy styled text form several fields into a single one and print it (scrolling or not). If you want to copy several objects then try to use the copy command, look it up in the dictionary. You can copy a whole card too:

Code: Select all

on mouseUp
  copy this card to stack "target"
end mouseUp
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Post Reply