Hi all
I am trying to parse an XML file (using InternetOpenURL and InternetReadString) and trying to find a specific value within the field for a specific currency (i.e. show the %short and %long values for EURUSD). However i am getting an error message within the loop when reading the XML file as it expects a number or boolean.
Sample code:
while( ( str = InternetReadString( ih ) ) != "" )
{
if((StrFind(str,"<name>") or StrFind(str,"<shortPercentage>") or StrFind(str,"<longPercentage>") ))
/* Read the name of symbol */
{
str1= str;
str1 = StrTrim(str1,"\t");
str1 = StrTrim(str1,"");
str1 = StrTrim(str1,"<name>");
str1 = StrTrim(str1,"</");
}
/* if symbol is EURUSD output %long and %short */
if (str1 = "EURUSD")
if(StrFind(str,"<shortPercentage>"))
{
str2 = str;
str2 = StrTrim(str2,"\t");
str2 = StrTrim(str2,"");
str2 = StrTrim(str2,"<shortPercentage>");
str2 = StrTrim(str2,"</");
str2 = " - "+str2;
}
if(StrFind(str,"<longPercentage>"))
{
str3 = str;
str3 = StrTrim(str3,"\t");
str3 = StrTrim(str3,"");
str3 = StrTrim(str3,"<longPercentage>");
str3 = StrTrim(str3,"</");
str3 = " - "+str3;
}
GfxTextOut( str1 + str2 + str3, x, y );
}
}
InternetClose( ih );
Any suggestions please ?
Regards