![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Aug 2004
Posts: 2
Rep Power: 0
![]() |
O.K, this may be easiest thing in the world to do, but I don't know how to save data (e.g ComboBox Items) from a VB6 application into a text file (without a flex grid). I can load from a file, and do so using this code:
Private Sub Form_Load() Dim file As String file = "h:\DL - BRU.txt" Open file For Input As #1 row = 1 Do Until EOF(1) Input #1, rm(row) cmbNo.AddItem rm(row), num(row) Form3.cmbNo.AddItem rm(row), num(row) row = row + 1 Loop |
|
|
|
|
|
#2 |
|
Programming Guru
![]() ![]() |
If you are needing to save a variable to disk as a file, add this function to your project (cut & paste) and then use the example below for how to call it.
Private Function SaveFile(txtFile, ByVal MyText As String) Dim FileNum As Integer FileNum = FreeFile() Open txtFile For Output As FileNum Print #FileNum, MyText; Close FileNum End Function strVarA You would use like so: SaveFile "D:\File.txt", strVarA You do not need to use a variable in place of strVarA, you can just put the text you want to save inside of quotes. SaveFile "D:\File.txt", "This is the contents of File.txt"
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Aug 2004
Posts: 2
Rep Power: 0
![]() |
Thanks
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|