954,582 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Reading and Writing Data to a File

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 >_>

Phenomena
Newbie Poster
1 post since Oct 2005
Reputation Points: 10
Solved Threads: 0
 

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.

pattyandme
Newbie Poster
4 posts since Apr 2006
Reputation Points: 10
Solved Threads: 0
 

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.

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You