| | |
Reading and Writing Data to a File
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Oct 2005
Posts: 1
Reputation:
Solved Threads: 0
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 >_>
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 >_>
•
•
Join Date: Apr 2006
Posts: 4
Reputation:
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.
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.
![]() |
Similar Threads
- Writing data into a file (C)
- Writing data to a file. (C++)
- help me to read my data file:(( (C)
- Reading from external data file (C++)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: log file
- Next Thread: how to make a stop watch
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






