|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (6 bit)
Join Date: Aug 2003
Posts: 61
|
Save Functionality in VB 6.0
I making a program that is similar to Notepad. How do I a save and open funtionality to the program.
Thanks. |
|
|
|
|
|
#2 |
|
Member (7 bit)
Join Date: Sep 2003
Posts: 90
|
well, they already did the code for the open/save dialog boxes. i forget the exact code as i have only dabbled in vb for a little while, but if you want, i can look at my old work.
but, this dialogue box is only a fancy way of getting a filename, after that, your open/save code must read/write to that file. simply and naively, this can be done with Dim NextLine As String On Error GoTo ErrHandler Open InFile For Input As #1 Line Input #1, NextLine Close #1 Exit Sub :ErrHandler MsgBox "you did something wrong", . . . End Sub for writing: Dim NextLine As String On Error GoTo ErrHandler Open OutFile For Output As #1 Print #1, "foo" Close #1 Exit Sub :ErrHandler MsgBox "you did something wrong", . . . End Sub this means of writing/reading is machine dependent, meaning windows will output \r\n for newlines, unix \n, macs \r. and inputting will only read until it reaches \r\n, \n, \r depending on os. this really does not matter (but, in my case it did). there is probably a better way of doing this. check out some vb boards. that is where i got my help. AS |
|
|
|
|
|
#3 |
|
Member (7 bit)
Join Date: Sep 2003
Posts: 90
|
oh, silly me.
this is using the built in "File" control widget do-dad. these are added just like buttons, lists, radios, etc. AS |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|