Page Index Toggle Pages: 1 [2]  Send Topic Send Topic Print Print
Hot Topic (More than 10 Replies) [Solved] Read value from Internet (Read 1595 times)
obfusc88
Full Member
***
Offline


No personal text

Posts: 194
Joined: Dec 17th, 2005
Re: Read value from Internet
Reply #15 - Oct 3rd, 2007 at 9:52pm
Print Post Print Post  
This is my version after the sample from Ray The Reaper.  I wish i had that example a weekago.  But got a chance to lern a lot.
Quote:
/*  This button downloads a page from the internet.
File is INI file structure like this:
[Customer123]
Cust123value

[Customer234]
Cust234value

[Customer345]
Cust345value

Routine should look for [ThisCustomer] and get the next value.
-----------------
*/

var vCustID as String
var vValuePage as String
var vContent as String
var vPos as Int            

vCustID = "[Customer234]"      

// Get file from Internet
vValuePage = @HTTPGetHTML("www.mywebsite.com","/TestValues.txt","",80)

// Remove trailing <cr> tags
vValuePage = @Replace(vValuePage,@Chr(13), "")

SetStringArraySeparator(@NewLine())
vPos = @FindStringArray(vValuePage, vCustID)
vContent = @AccessStringArray(vValuePage, vPos + 1)
WriteLn("The value for " + vCustID + "is: " + vContent)
RestoreStringArraySeparator()

//Can now make decisions based on value of vContent. 
So now you can mark this one as SOLVED becausee this is what i wanted to get.  I am very happy and say thank you ofr all the help.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send Topic Send Topic Print Print