943,453 Members | Top Members by Rank

Ad:
Dec 10th, 2004
0

reading and saving data to textfiles...

Expand Post »
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
Similar Threads
Reputation Points: 46
Solved Threads: 0
Light Poster
gkdmaths is offline Offline
36 posts
since Jan 2004
Dec 11th, 2004
0

Re: reading and saving data to textfiles...

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)
Reputation Points: 11
Solved Threads: 0
Light Poster
Buff is offline Offline
40 posts
since May 2004
Dec 11th, 2004
0

Re: reading and saving data to textfiles...

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
Reputation Points: 10
Solved Threads: 0
Junior Poster
yni420 is online now Online
103 posts
since Oct 2004
Dec 14th, 2004
0

Re: reading and saving data to textfiles...

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.
Reputation Points: 46
Solved Threads: 0
Light Poster
gkdmaths is offline Offline
36 posts
since Jan 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: Please recommend a freeware VB complier for Windows XP
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Junior High Computer teacher needs help!!





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


Follow us on Twitter


© 2011 DaniWeb® LLC