Saving DataGrid data to Text Files

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

Post Reply
FinishTheCode
Posts: 5
Joined: Wed Apr 17, 2013 3:53 pm

Saving DataGrid data to Text Files

Post by FinishTheCode » Tue May 07, 2013 1:28 pm

How would I go about saving Datagrid Data to a text file?

Cheers guys :)

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

Re: Saving DataGrid data to Text Files

Post by Klaus » Tue May 07, 2013 1:32 pm

Hi FinishTheCode,

if it is a datagrid of type TABLE, then you can simply export to a text file with:
...
put the DGTEXT of grp "your datagrid here" into url("file:DG_Content.txt")
...
"the DGTEXT of grp xyz" is a TAB and CR delimited text!

Read in:
...
set the DGTEXT of grp "your datagrid here" to url("file:DG_Content.txt")
...

If it is of type FORM, then you will need to convert "the DGData of grp XYZ",
which is an array actually to a string and save that.
Drop a line if that is the case.


Best

Klaus

Post Reply