Datagrid data to text file
Fredrik Andersson
fredrik at morbug.se
Wed May 13 02:29:34 EDT 2009
Whoops, missed a line from my code:
ON mouseUp pMouseBtnNo
put empty into tData
put the dgData of group "DataGrid List" into theDataA
REPEAT WITH i = 1 to the number of lines in the keys of theDataA
put theDataA[i]["Ägr"] & ";" & theDataA[i]["Dnr"] & ";" &
theDataA[i]["Pnr"] & ";" & theDataA[i]["Namn"] & ";" & theDataA[i]
["Påbörjad"] & ";" & theDataA[i]["Avslutad"] & ";" & theDataA[i]
["Text"] & ";" & theDataA[i]["Dagbok"] into tLine
put tLine & return after tData
END repeat
put tData into URL("file:" & fld "sökväg" & fld "opid")
END mouseUp
- Fredrik
13 maj 2009 kl. 08.26 skrev Fredrik Andersson:
> Hi,
>
> This is my own newbie solution. Looping through the array I'm
> afraid ;) You can probably use the Split/Convert commands (or other
> means) to do it a lot more efficiently.
>
>
> ON mouseUp pMouseBtnNo
> put empty into tData
> put the dgData of group "DataGrid List" into theDataA
> REPEAT WITH i = 1 to the number of lines in the keys of theDataA
> put theDataA[i]["Ägr"] & ";" & theDataA[i]["Dnr"] & ";" &
> theDataA[i]["Pnr"] & ";" & theDataA[i]["Namn"] & ";" & theDataA[i]
> ["Påbörjad"] & ";" & theDataA[i]["Avslutad"] & ";" & theDataA[i]
> ["Text"] & ";" & theDataA[i]["Dagbok"] into tLine
>
> END repeat
>
> put tData into URL("file:" & fld "sökväg" & fld "opid")
>
> END mouseUp
>
> Regards,
>
> Fredrik
>
> 13 maj 2009 kl. 07.49 skrev Yves COPPE:
>
>> Hello list,
>>
>> I want to export the data of a datagrid form to a text file (tab-
>> tab-return text file)
>>
>> I've tried with the dgtext of group "dataGrid 1" but the columns
>> are not in the properly order
>>
>> So I try with the dgData of group "dataGrid 1"
>> but it gives me an array data
>>
>> How can I convert this array data in a text ?
>>
>> (there are 4 columns in the datagrid and the number of rows is a
>> variable)
>>
>> Thank you very much.
>>
>>
>> Greetings.
>>
>> Yves COPPE
>> yvescoppe at skynet.be
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list