gettingstarted
[Top] [All Lists]

Re: (no subject)

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Re: (no subject)
From: Phil Heycock <pheycock at bellsouth dot net>
Date: Sat, 31 Jul 2004 22:34:25 -0400
Delivered-to: gettingstarted at lists dot realsoftware dot com
Delimit your edit fields with a character that you are sure will not appear
in text. The 'pipe' character ("|") is often used for this purpose. Assume
some arbitrary number of edit fields in a control array:

Dim saveStr As String = EditField1(0)
Dim i As Integer = 1
Do Until EditField1(i) = Nil
    saveStr = saveStr + "|" + EditField1(i)
    i.Increment
Loop

When you read the saved string from file, use nthField Function to break out
the pipe-delimited substrings and place them in their proper edit fields.

PWH

*************************************

on 7/31/04 8:48 PM, Greg Olson-Hyde at isomfield at optusnet dot com dot au 
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
> 
> RB 5.5.2, Mac OS X 10.3.4
> Cheers
> 
> Greg
> Sydney Australia

_______________________________________________
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>