Reading and Writing Data to a File

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2005
Posts: 1
Reputation: Phenomena is an unknown quantity at this point 
Solved Threads: 0
Phenomena Phenomena is offline Offline
Newbie Poster

Reading and Writing Data to a File

 
0
  #1
Oct 16th, 2005
I recently started to create a tag editor/creator for the game halo. It wasnt till just now that I have no idea how to read and write data from files. :rolleyes:

so my question is: how could i open a file with the common dialog, and have it automatically display certain offsets in certian textboxs, so for example, offset 0x04 would be in text1, 0x08 in text2 and offset 0x1C in text3.

you can contact me on AIM at DuckM45ter or just post here >_>
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 4
Reputation: pattyandme is an unknown quantity at this point 
Solved Threads: 0
pattyandme pattyandme is offline Offline
Newbie Poster

Re: Reading and Writing Data to a File

 
0
  #2
Apr 8th, 2006
depends on how the origional file is formated
for instance if it reads line by line or a silgle line to eof.

dim confdat,yourfile,variable(0 to number of file lines) as string

cmdl.action = 1

yourfile = cmdl.filename
x = 0
Open yourfile For Input As #1
Do While Not EOF(1)
Line Input #1, confdat
variable(X) = confdat
X = X + 1
Loop
Close #1

will put each line as 1 line in the variable(x) array then do someting with the info to identify the information you need then feed those variables to your text boxes.

if left$(variable(1),4) = "0x08" then textbox.text = right$(varabie(1),9)

like i said it depens on how the origional file is formated and how you format the input to the variable(x) when reading the file.

note if your going to use the if then statments outside the sub rutine then make the variable array global in a modual
cause i dont know how to make them global from within the sub.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Reading and Writing Data to a File

 
0
  #3
Apr 8th, 2006
We love all information we can get, but do me a big favor. Threads, and Lazarus, should have nothing to do with each other.... so let's not resurrect dead threads.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC