| | |
reading and saving data to textfiles...
![]() |
So school's out for a month and Ive been doing some hobby VB6 programming...
Im writing calculators involving up to 25 variables, many constants, etc, etc, etc..
So, instead of requiring the user to input all the vars I thought I'd allow the loading of comma- or tab-delineated textfiles with appropriate values already there for particular cases.
For instance, to calculate the concentration of an organic acid in equilibrium with X other species in solution of X unknowns at, say, standard temp and pressure; all the user would have to do is load that file and input one or two values. Additionally, I would like to allow for saiving the file if the user wanted to change the inputs for compund- or solution-specific, non-ideal conditions...
So can you all recommend a simple tutorial that will discuss the process of how to load/save the files?
TIA!
-gkd
Im writing calculators involving up to 25 variables, many constants, etc, etc, etc..
So, instead of requiring the user to input all the vars I thought I'd allow the loading of comma- or tab-delineated textfiles with appropriate values already there for particular cases.
For instance, to calculate the concentration of an organic acid in equilibrium with X other species in solution of X unknowns at, say, standard temp and pressure; all the user would have to do is load that file and input one or two values. Additionally, I would like to allow for saiving the file if the user wanted to change the inputs for compund- or solution-specific, non-ideal conditions...
So can you all recommend a simple tutorial that will discuss the process of how to load/save the files?
TIA!
-gkd
•
•
Join Date: May 2004
Posts: 40
Reputation:
Solved Threads: 0
Dont know about VB but for PB for windows it should be easy
open filename$ for binary as #1
get$ #1,lof(1),info$
numberoffields&=parsecount(info$)
dim myarray$(numberoffields&)
for k&=1 to numberoffields&:myarray$(k&)=parse$(info$,k&):next:close #1
something like that (default of parse is comma delimiter)
open filename$ for binary as #1
get$ #1,lof(1),info$
numberoffields&=parsecount(info$)
dim myarray$(numberoffields&)
for k&=1 to numberoffields&:myarray$(k&)=parse$(info$,k&):next:close #1
something like that (default of parse is comma delimiter)
Hi
Before you ask for any help in VB
Check this first always
http://msdn.microsoft.com/
and search there
I have always found that this site gives answers to most microsoft related queries
If you dont find what you need PM me i will send across a sample as to how to save to text files
yni420
Before you ask for any help in VB
Check this first always
http://msdn.microsoft.com/
and search there
I have always found that this site gives answers to most microsoft related queries
If you dont find what you need PM me i will send across a sample as to how to save to text files
yni420
Er...um. :o
Sorry for the stupid thread. I developed a realy cool solution to my problem that reads each value from a CSV by splitting the string and then appends the file onthefly ('kind of') to a temp file, for which a new CSV line is written everytime the program goes through 10 iterations of the calculation, then at the end of the routine reads the final values (last lin) from the temp file which are written into the the app and then optionally saved into original file and stored as the resultant theoretical solution properties.
Im working on a method to compare this to lab measured values now.
thanks for all your help.
Sorry for the stupid thread. I developed a realy cool solution to my problem that reads each value from a CSV by splitting the string and then appends the file onthefly ('kind of') to a temp file, for which a new CSV line is written everytime the program goes through 10 iterations of the calculation, then at the end of the routine reads the final values (last lin) from the temp file which are written into the the app and then optionally saved into original file and stored as the resultant theoretical solution properties.
Im working on a method to compare this to lab measured values now.
thanks for all your help.
![]() |
Similar Threads
- Reading internet data using a C++ program (C++)
- reading, modifying data within .csv file (C++)
- reading a specific data in .txt file to put in specific tag in xml in vb.net (VB.NET)
- Saving data inside exe again... (C++)
- reading column data (Python)
- Perl/CGI (Saving Data) Part III (Computer Science)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Please recommend a freeware VB complier for Windows XP
- Next Thread: Junior High Computer teacher needs help!!
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college 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 save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





