Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Registry & File Input / Output

Post new topic   Reply to topic
VB6 and Text Files - External Data
View previous topic :: View next topic  
Author Message
MilhoXP
Newbie


Joined: 11 Aug 2005
Posts: 1
Location: Brazil

PostPosted: Aug 12th, 2005 01:54 PM    Post subject: VB6 and Text Files - External Data Reply with quote

Hi. I'm developing a software where I need to register some configuration data in a text file with a diferent extension (for example: data.cfg). Is there any way to read a specified line (for example: the line starts with "language" and beside it is the language definition) and write data on it? I have never used external files on VB. Thx.
_________________
MilhoXP
**The Choosen**
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger ICQ Number
RoofRabbit
Regular


Joined: 06 Jul 2005
Posts: 95
Location: Lenoir, NC USA

PostPosted: Aug 12th, 2005 08:32 PM    Post subject: Reply with quote

Actually, Yes.

When you read from and write to your own files that your program would understand, you can place any data you have in it in any order you wish. The file may be named anything you wish. I wouldn't name it with an .exe extension or the such because windows could get confused if it were clicked on by some other program.

An example is almost all the stuff I write has a basic module (Preference.bas) which has a custom UDT (user data type). It in, it stores the window positions of any forms I have in the program. It may also store the last filename my app used or whatever user preference that would be related to my app in it. Point being, I often name the file with the app's name with the extension of ".Preferences". A menu creator app I made saves it's user prefs as "MenuCreator.Preferences".

The file extension you choose to use should be one that would not conflict with a default file association in windows. And remember, the old days of a maximum of 3 letters in the extension has been gone since win95. That's why I chose to completely spell out the word "Preference" as my file's extension, it tells what the file is.

You should also understand, you don't need a file extension at all if only your program will be reading and writing to it.
_________________
Website - [link]
Back to top
View user's profile Send private message Visit poster's website ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Registry & File Input / Output All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic