gettingstarted
[Top] [All Lists]

Re: (no subject)

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Re: (no subject)
From: "Jon" <jon at scruffyduck dot co dot uk>
Date: Sun, 01 Aug 2004 03:06:20 +0100
Delivered-to: gettingstarted at lists dot realsoftware dot com
Priority: normal
On 1 Aug 2004 at 10:48, Greg Olson-Hyde wrote:

> G'day all
> 
> Terry requested another question, so here it is  :-)
> 
> I have an EditField that I am saving to, and loading from, a text file. 
> I have the ability to save and load 'multi lines' with carriage 
> returns.
> 
> So far so good, all is functioning, but...
> 
> I want to save and load 'multi lines' using more than one EditField. I 
> can see how to save many 'single line' strings to one file but how can 
> I save many 'multi line' strings with one or many carriage returns from 
> many EditFileds to the same text file. I will use a database if 
> required but as there will only ever be one record this may be 
> overkill. Does this make sense?
> 
> The code I am using to load multi line text into one EditField is below:
> 
>    Dim f As folderItem
>    Dim t As textInputStream
>    f = preferencesFolder.child("Notes")
>    if f <> nil then
>      if f.exists then
>        t = f.OpenAsTextFile
>        if t <> nil then
>          psNotesText = t.readAll
>          efMyNotes.Text = psNotesText
>          t.close
>        end if
>      end if
>    end if
> 

Hi Greg 

I have done something similar - I have a small datafile class which 
stores multiple fields in a comma delimited text file.  I can save 
both commas and carriage returns in the file.  What I do is to pass 
the individual pieces of data (which I get from various edit fields - 
some single line and others multi line - through a method which 
converts the commas and carriage returns to another character which 
are not normally used ( I stop the user from using them)  such as | 
for carriage return and ¬ for a comma.   I then concatentate the 
individual 'fields' together with commas in between and save the 
file. When I load the file back in I just convert them back to commas 
or carriage returns as I load the data back into the editfields.

Dunno if that helps

regards

Jon


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>