Export from one stack, inport to another

Are you using LiveCode to create server scripts or CGIs?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Tom in Carrboro
Posts: 4
Joined: Tue May 08, 2007 8:42 pm
Location: North Carolina

Export from one stack, inport to another

Post by Tom in Carrboro » Mon May 05, 2008 10:04 pm

Is it possible that someone can please tell me or show me how to "export data" and then "import it into a stack."

I set up my working stack incorrectly, and Jacqueline at the help desk has instructed me on what I should have done. That stack is now quite large, but she tells me I can correct it if I — as she says — "do some cleanup. The easiest way would probably be to export all the data, and then import it into a stack that has the correct background set up."

I now know how to create that "correct background" but not how to export or import.

Thank you for helping, if you can.

TominCarrboro
Tom

Mark Smith
Posts: 179
Joined: Sat Apr 08, 2006 11:08 pm
Location: London, UK
Contact:

Post by Mark Smith » Tue May 06, 2008 2:36 am

Tom, could you tell us how you've stored the data? Is it stored in fields, or custom properties or...?

There are many ways to store data in a stack, so we'd need to know how you've done it before offering a solution.

Best,

Mark Smith

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

Post by BvG » Tue May 06, 2008 10:31 am

Generally speaking you can use the "file:" form of urls to put and get data. How exactly you'd do that is of course up to you, and how your stack is made.

Example:

Code: Select all

on mouseUp
  answer file ""
  if it = "" or the result <> "" then
    exit mouseUp
  end if
  put field "someField" into url ("file:" & it)
end mouseUp
Other example:

Code: Select all

on mouseUp
  answer folder "folder with text files"
  if it = "" or the result <> "" then
    exit mouseUp
  end if
  repeat for each line theLine in theFiles
    add one to x
    create field
    set the text of field x to url ("file:" & theLine)
end mouseUp
things to look up:
answer file command
answer file with type command
answer folder command
defaultfolder property
url keyword
file keyword
binfile keyword
files function
Various teststacks and stuff:
http://bjoernke.com

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

Tom in Carrboro
Posts: 4
Joined: Tue May 08, 2007 8:42 pm
Location: North Carolina

Post by Tom in Carrboro » Thu Apr 16, 2009 9:41 pm

Mark Smith and BvG,

It's been more than a year since I looked at this page because a friend came to the house and showed me how to solve the problem. I don't want you to think I was rude, although I was forgetful in not clearing the problem.

Thanks for caring, though.

Tom in Carrboro
Tom

Post Reply

Return to “CGIs and the Server”