Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

update memo

5 views
Skip to first unread message

Li Tan

unread,
Jan 21, 2002, 11:47:27 PM1/21/02
to
Hi, I met a problem to update the text in TMemo. The text in memo is loaded
from a file, and I want to update text in memo since that file is changed. I
cannot use Memo->Lines->Loadfromfile("myfile.txt") because of error.

What should I do?

Thanks


Mark Cashman

unread,
Jan 21, 2002, 10:47:41 PM1/21/02
to
Hi, Li Tan!

What error do you get?

------
Mark Cashman (TeamB - C++ Builder), creator of The Temporal Doorway at http://www.temporaldoorway.com
(original digital art, writing, music and more)
C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring (Join us!)
http://www.temporaldoorway.com/programming/index.htm
------

Remy Lebeau

unread,
Jan 22, 2002, 12:52:04 AM1/22/02
to
Please don't cross-post, it's against Borland newsgroup guidelines. You're
supposed to only post to one most-appropriate group, which in this case is
borland.public.cppbuilder.vcl.components.using


Gambit

"Li Tan" <li...@ou.edu> wrote in message news:3c4cd2fd$1_2@dnews...

Li Tan

unread,
Jan 22, 2002, 3:08:40 AM1/22/02
to
I can post any question in this group as long as I am a student!

Li
"Remy Lebeau" <gamb...@gte.net> wrote in message news:3c4cfdcb$1_1@dnews...

Li Tan

unread,
Jan 22, 2002, 3:17:53 AM1/22/02
to
Hi, the error message I got is exception class EFOpenError with message
'Cannot open the generator.txt. In my update function, I used
Memo1->Lines->LoadFromFile("generator.txt"); again.

What's wrong with it?

Li


Remy Lebeau

unread,
Jan 22, 2002, 3:08:43 AM1/22/02
to
The only time LoadFromFile() throws an EFOpenError exception is when the
specified file can't be opened, usually because it doesn't exist. Are you
making sure the file exists before you try to open it?

if(FileExists("C:\\generator.txt"))
Memo1->Lines->LoadFromFile("C:\\generator.txt");

You should always use full paths whenever possible, otherwise the filename
is relative to the process's current working directory, which can change at
any moment, and many times, during a program's execution.


Gambit

"Li Tan" <li...@ou.edu> wrote in message news:3c4d0451_2@dnews...

Remy Lebeau

unread,
Jan 22, 2002, 3:03:12 AM1/22/02
to
You obviously never read the newsgroup descriptions before
(http://www.borland.com/newsgroups/cppbnewsdesc.html), they exist for a
reason:

borland.public.cppbuilder.students - Discussions on issues of interest to
students.

borland.public.cppbuilder.vcl.components.using - Usage of non-data aware
user interface components and form objects. Posting on threads should be
made to borland.public.cppbuilder.winapi, posting on non-component classes
(like AnsiString and TStringList) should be made to
borland.public.cppbuilder.language, and posting on database and data aware
components should be made to borland.public.cppbuilder.database.desktop


Gambit

"Li Tan" <li...@ou.edu> wrote in message news:3c4d0226$1_2@dnews...

Ed Mulroy (TeamB)

unread,
Jan 22, 2002, 11:49:49 AM1/22/02
to
> I can post any question in this group as long as I am a student!

Then don't also post the same message in another group.

. Ed

0 new messages