I am working with a program which by design must read sequential lines of a
.csv file. An exerpt of the code is listed below.
My question is, what increments the line that is read into the string
variable "Params"? The "FileNum" is set once in the begining and I'm not
aware of anything that would change it. Does ReadFileLine automatically
increment? I don't know for sure that this program actually works. It was
given to me as an example of how what I need to code was done in the past.
Thanks.
FileNum := OpenFile("/FBFile.csv", 0); // open the file
Params = ReadFileLine(FileNum); // read the first line. Params is a String
Variable
//that holds the entire line (row) of data.
// loop until all lines containing values are read
while(Params != "")
{
delim1 = Find(Params, ',', 0); //Location of 1st Comma
delim2 = Find(Params, ',', 1); //Location of 2nd Comma
delim3 = Find(Params, ',', 2); //Location of 3rd Comma
delim4 = Find(Params, ',', 3); //Location of 4th Comma
delim5 = Len(Params); //Location of last character in string named
Params
RecipeNumber2 = TextToInt(Mid(Params, 0, delim1),10); //Parse Framing
Bead
// Recipe Number (Tag name "FBNumber")
// Parse StoredNames Value
StoredNames[RecipeNumber2] = Mid(Params, delim2+1, delim3-delim2-1);
// Parse RecipePointer Value
RecipePointer[RecipeNumber2] = Mid(Params, delim4+1, delim5 -
delim4-1);
Params = ReadFileLine(FileNum); // read next line
}
--
View this message in context:
http://www.nabble.com/ReadFileLine-Question-tp17450157p17450157.html
Sent from the C-prog mailing list archive at Nabble.com.