- read a string from Internet resource
File Input/Output functions
|| InternetReadString( handle )
|| The function reads a string (line) from internet resource
- If End-Of-File has been reached, the function returns empty string ("")
- If End-of-File has NOT been reached, the function always returns non-empty string because each line read by this function ends with new line character "
", so if server has sent empty line it will be read as "
- You can trim new line characters using StrTrim
Internet* functions open wide area of applications including:
- querying web APIs for extra data
- using web/rest APIs for communication ( sending messages/alerts to Twitter, SMS gateways, etc)
ih = InternetOpenURL( "https://www.quandl.com/api/v3/datasets/SEC/AAPL_SALESREVENUENET_Q.csv?api_key=" );
printf( "AAPL Revenue:
if( ih )
while( ( str = InternetReadString(
ih ) ) != "" )
printf( "%s", str );
InternetClose( ih );
The InternetReadString function is used in the following formulas
in AFL on-line library:
See updated/extended version on-line.