Could you give me an example please?
Here you are. I also sent you a private message.
/* This program reads a file where the tag names and its values are stored in */
int tagindex; int Hfile; int count; int space1; int space2; int decimal;
int IntValue; float FloatValue;
cstring line; cstring TagName; cstring TextValue;
//Open file
Hfile := OpenFile("/param/param.txt", 1);
//Read a line from the file
line := ReadFileLine(Hfile);
//While the line read from the files retrieves something, keep reading
while (Len(line)>0)
{
//Read the position of the first and second space occurrence
//Example of line: Polisher_System.Polisher.Vibration 22 mm/s
space1 := Find(line,' ',0);
space2 := Find(line,' ',1);
//The tag name is the section before the first space
TagName := Left(line, space1);
//The tag value is located between the first and the second spaces
TextValue := Mid(line, space1+1, space2-space1);
//Find the tag index
tagindex = FindTagIndex(TagName);
//Find out if the value is decimal (has a ".")
decimal := Find(TextValue,'.',0);
//Write the value to the corresponding tag in Crimson
if (decimal == 0)//If the tag is a integer
{IntValue= TextToInt(TextValue,10);
SetIntTag(tagindex,IntValue);}
else //If the tag is a float
{FloatValue= TextToFloat(TextValue);
SetRealTag(tagindex,FloatValue);}
//Read a new line from the file
line := ReadFileLine(Hfile);
}
//Close the file
CloseFile(Hfile);