Text1.text saving and reading?

Hyber
10-11-2004, 05:41 AM
I'm busy creating some Memo program, all running fine not. Only 1 more problem.

I want it to save on each letter ( Put saving in text1_change )
and to load it when you open the program ( In form_load )

But I can't find the commands, tried File I/O tutorial but didn't exactly found what I need to know.

I have:

ChDir App.Path
Open "memo.sav" For Output As #2
Write #2, Memo.Text
Close #2

for saving and:


ChDir App.Path
Open "memo.sav" For Input As #1
Read (1), Memo.Text
Close #1


for loading.

It gives errors, help me?

malloc
10-11-2004, 05:50 AM
Use the Input statement to read the file, not Read. :)

Hyber
10-11-2004, 09:16 AM
Use the Input statement to read the file, not Read. :)

Well, that problem was some different:

Fixed code:


Memo.SaveFile App.Path + "\memo.sav"


Thanks anyway.

-> Please goto Calendar help now :) :P

MikeJ
10-11-2004, 10:11 AM
You should have mentioned you were using a RichTextBox. :) (You can also use LoadFile to load the file, if you are so inclined. :))

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum