944,120 Members | Top Members by Rank

Ad:
Oct 16th, 2005
0

Reading and Writing Data to a File

Expand Post »
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 >_>
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Phenomena is offline Offline
1 posts
since Oct 2005
Apr 8th, 2006
0

Re: Reading and Writing Data to a File

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pattyandme is offline Offline
4 posts
since Apr 2006
Apr 8th, 2006
0

Re: Reading and Writing Data to a File

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.
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: log file
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: how to make a stop watch





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC