reading and saving data to textfiles...

Reply

Join Date: Jan 2004
Posts: 36
Reputation: gkdmaths will become famous soon enough gkdmaths will become famous soon enough 
Solved Threads: 0
gkdmaths's Avatar
gkdmaths gkdmaths is offline Offline
Light Poster

reading and saving data to textfiles...

 
0
  #1
Dec 10th, 2004
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
Reply With Quote Quick reply to this message  
Join Date: May 2004
Posts: 40
Reputation: Buff is an unknown quantity at this point 
Solved Threads: 0
Buff Buff is offline Offline
Light Poster

Re: reading and saving data to textfiles...

 
0
  #2
Dec 11th, 2004
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)
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 102
Reputation: yni420 is an unknown quantity at this point 
Solved Threads: 0
yni420's Avatar
yni420 yni420 is offline Offline
Junior Poster

Re: reading and saving data to textfiles...

 
0
  #3
Dec 11th, 2004
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
Reply With Quote Quick reply to this message  
Join Date: Jan 2004
Posts: 36
Reputation: gkdmaths will become famous soon enough gkdmaths will become famous soon enough 
Solved Threads: 0
gkdmaths's Avatar
gkdmaths gkdmaths is offline Offline
Light Poster

Re: reading and saving data to textfiles...

 
0
  #4
Dec 14th, 2004
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC