It looks like the missing ) was the final answer. Here is the final programming to get the value:
/* 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 vFileHandle as Int
var vContent as String
vCustID = "[Customer234]"
// Get file from Internet
vValuePage = @HTTPGetHTML("
www.mywebsite.com","/TestValues.txt","",80)
// Remove trailing <cr> tags
vValuePage = @Replace(vValuePage,@Chr(13), "")
// Read file to find first line of INI Group
//Save results as a file, then open and read lines
If FileExists("tempfile.txt") Then {
FileDelete("tempfile.txt")
}
vFileHandle = FileOpen("tempfile.txt")
FileWrite(vFileHandle,vValuePage)
// Value will be the first line after the line with [vCustID]
// Could put inside loop for total file size to force an end if no match found
If vFileHandle >= 0 Then {
FileSeek(vFileHandle, 0)
While(vContent <> vCustID) {
FileReadLn(vFileHandle, vContent)
}
FileReadLn(vFileHandle, vContent)
WriteLn("The value for " + vCustID + "is: " + vContent)
FileClose(vFileHandle)
FileDelete("tempfile.txt")
} Else {
WriteLn("Could not get values from Internet")
}
//Can now make decisions based on value of vContent.
And now I see another answer from Ray the Reaper that looks a lot easier. Only 4 lince of programmming and no files to open/close/delete, And no loop that could run forever if match not found. I think I will use that one instead of this one.