You are better of creating CSV files so you can handle carriage returns
etc. there are a few tech notes on the subject

Regards
Chuck
On Tue, Aug 13, 2019 at 6:30 PM Adam Bevan via 4D_Tech <[email protected]>
wrote:

> Chips solution probably the quickest.
> I ended up writing to a tab deliminated text file, so I could load it up
> into a spreadsheet.
>
> $vH_FileRef:=Create document($vT_FilePath)
> LISTBOX GET
>
> ARRAYS(*;$vT_ListboxName;$aT_ColumnNames;$aT_HeaderNames;$aptr_ColumnVars;$aptr_HeaderVars;$aB_ColVisible;$aL_ColStyle)
>
> $ vL_rCount:=Size of array($ aptr_ColumnVars{1}->)
> For($vL_rNum;1;$vL_rCount)
> CLEAR VARIABLE($vT_TextToWrite)
>
> $vL_Count:=$aT_ColumnNames
> for($vL_cNum;1;$vL_cCount)
> if(length($vT_TextToWrite)#0)
> $vT_TextToWrite:=$ vT_TextToWrite +Char(tab)
> end if
> Case of
> :(Type($vptr_Column->{$vL_cNum})=Is Text)
> $vT_TextToWrite:=$vT_TextToWrite+$vptr_Column->{$vL_cNum}
>
> : (Type($vptr_Column->{$vL_Num})=Is date)
> $vT_TextToWrite:=$vT_TextToWrite+String(Year
> of($vptr_Column->{$vL_Num}))+"-"+String(Month
> of($vptr_Column->{$vL_Num}))+"-"+String(Day of($vptr_Column->{$vL_Num}))
>
> :(Type($vptr_Column->{$vL_cNum})=Is Time)
> $vT_TextToWrite:=$vT_TextToWrite+String($vptr_Column->{$vL_cNum};HH MM SS)
>
> :(Type($vptr_Column->{$vL_cNum})=Is Longint)
> $vT_TextToWrite:=$vT_TextToWrite+String($vptr_Column->{$vL_Num})
>
> else   // unsupported array types
> // don't write to text file.
> end case
> end for   // each column
>
> $vH_FileRef:=Append document($vT_FilePath)
> SEND PACKET($vH_FileRef;$vT_TextToWrite)
> end for   // each row
>
> CLOSE DOCUMENT($vH_FileRef)
>
> Adam Bevan
> Developer & CEO, Argus Productions Inc.
> <https://www.facebook.com/ArgusProductions/>
>
>
> On Tue, 13 Aug 2019 at 15:29, Peter Mew via 4D_Tech <[email protected]>
> wrote:
>
> > Hi
> > Does anyone have a routine, component, plugin, or pointer to the right
> > direction, that will save the contents of an array based listbox, so that
> > the data can be restored at a later date
> > thanks
> > -pm
> > 4d v13
> > **********************************************************************
> > 4D Internet Users Group (4D iNUG)
> > Archive:  http://lists.4d.com/archives.html
> > Options: https://lists.4d.com/mailman/options/4d_tech
> > Unsub:  mailto:[email protected]
> > **********************************************************************
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************

-- 
-----------------------------------------------------------------------------------------
 Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064
 Informed Solutions, Inc.
 Brookline, MA 02446 USA Registered 4D Developer
       Providers of 4D, Sybase & SQL Server connectivity
          https://www.informed-solutions.com
-----------------------------------------------------------------------------------------
This message and any attached documents contain information which may be
confidential, subject to privilege or exempt from disclosure under
applicable law.  These materials are intended only for the use of the
intended recipient. If you are not the intended recipient of this
transmission, you are hereby notified that any distribution, disclosure,
printing, copying, storage, modification or the taking of any action in
reliance upon this transmission is strictly prohibited.  Delivery of this
message to any person other than the intended recipient shall not
compromise or waive such confidentiality, privilege or exemption from
disclosure as to this communication.
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to