File I/O, Arrays, and Databases in Revolution
zelston at aol.com
Thu Mar 28 13:31:01 CST 2002
one month later and now I can answer questions!!!!
> fields, scientific notation fields, etc. In looking at the Revolution
> documentation, it appears that I have to somehow read or write each line
> as a string, then somehow parse each field from this string. So how do
> you do this efficiently in Revolution? Please note that the files
> created by the FORTRAN programs are fairly large.
open file filename for read
read from file until EOF
put it into DaFile
close file Filename
now DaFile is a copy of the contents of Filename and you can use string and
line manipulation on the variable DaFile
> The next question is how are arrays implemented in Revolution?. I've
> searched the documentation but haven't found anything. What I'd like to
> do is read in the FORTRAN files, putting the data into Revolution arrays
> for display or calculational analysis. How can this be done?
reading lines MUST occur with a variable, it doens't seem to work with files
just guessing here....
put line X of DaFile into MyLine
--make MyLine an array
--research the "split" command, arrays are not very well documented in the
split MyLine with somedelimiter
--get the keys of the array for later
put the keys of MyLine into MyKeys
now you have an array and the keys
> Finally, I tam interested in the database capabilities of Revolution
> (especially the Valentina engine). I'd like to read in the data from
> the FORTRAN files and directly put them into a database so that
> information can be searched, manipulated, calculated. etc. How can this
> be done?
can't help here, just about to try it myself...
More information about the use-livecode