gettingstarted
[Top] [All Lists]

Re: Saving data to an external file

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Re: Saving data to an external file
From: Russ Jones <r dot jones at sympatico dot ca>
Date: Sun, 30 Jul 2006 22:27:05 -0400
Delivered-to: listarchive at realsoftware dot com
Delivered-to: gettingstarted at lists dot realsoftware dot com
References: <20060731020619 dot 33946 dot qmail at web60412 dot mail dot yahoo dot com>
Hi Lennox.

The code below will only execute if myExpFile already exists.
"If f.exists then"

So if you are running for the first time, myExpFile won't exist yet, so it won't be created.

Once you have created myExpFile, this code will (correctly?) overwrite it.

Russ

On Jul 30, 2006, at 10:06 PM, Lennox Jacob wrote:

Hi Russ & Briman,
I have this:

Dim f As folderitem
Dim TOS As TextOutputStream

f = DesktopFolder.Child("myExpFile")
If f exists then
If f <> Nil then
TOS = f.CreateTextFile
TOS.WriteLine FirstName.Text
TOS.WriteLine LastName.Text
TOS.WriteLine Age.Text
TOS.WriteLine Address.Text
TOS.Close
end if
else
'do nothing
end if

but this does not create any file.
Any suggestions?
Thanks.
Lennox.

Russ Jones <r dot jones at sympatico dot ca> wrote: Hi Lennox.

I believe you would find the f=DesktopFolder() method useful.
You could use that to initialize a folderitem, then use the f.child
method to initialize each of your text files.

Russ

On Jul 30, 2006, at 8:42 PM, Lennox Jacob wrote:

Hello,
I have a Pushbutton named Export, which,when clicked, I would like
it to export data (EF1.text, EF2.text, EF3.text, EF4.text) from
some chosen editfields (EF1, EF2, EF3, EF4) to a new text file on
the desktop.
Not Save or SaveAs like when the whole document is saved.
How is that done?
Thanks.
Lennox.

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

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


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