Download PDF file
Transcript
• Get variable names from the file into a comma-separated string.
• Call TecUtilTecIni() to initialize the temporary file.
• Call TecUtilTecZne() to add a zone.
• Get data points into an array.
• Call TecUtilTecDat() to add the data points to the temporary file.
• Call TecUtilTecEnd() to close the temporary file.
There are other things that our conversion function will do, however, the steps listed above are the
minimum required. There are two functions used for parsing the income file. These are GetVars() and get_token(). GetVars() takes two parameters: a FILE* and a
StringList_pa. Be sure that you understand the StringList_pa data type before continuing. For a discussion of StringList_pa see the ADK User’s Manual. GetVars() will parse
the text file for the variable names and place them in the string list. get_token() takes a FILE*
and will parse a text file for items which are separated by commas or spaces. There is no checking
to make sure that the item is a valid number. get_token() will update a global variable called
_token, which is used in DoConversion():
static Boolean_t DoConversion(FILE
*f,
char *TempFName,
char **MessageString)
{
Boolean_t IsOk = TRUE;
StringList_pa VarList = TecUtilStringListAlloc(); /* Variable list. */
int i;
int NumValues;
int NumVars;
int IMax;
40