EDIT: Not needed anymore. Please delete thread. There is no outcome to this thread. Changed code direction. Thx
Hello, just wondering why the below code will display the working url properly when going down the list, in that, if the first link fails, it will go to the next one, then if that one fails will go to the next one but the problem is that if the first url link is good, it still goes down the list and if the last link is bad then the whole code doesn’t work.
url = "http://pastebin.com/raw/llwkkkcec"
If url <> "" Then url = "http://myserver1.com/ececeec.txt"
If url <> "" Then url = "http://myserver2.com/wecewwe.txt"
IDArray = getStreamId(url)
Good grief, no! You want to do something like this instead:
IDArray = getStreamId("http://pastebin.com/raw/llwkkkcec")
if idArray.count() < 1 then IDArray = getStreamId("http://myserver1.com/ececeec.txt")
if idArray.count() < 1 then IDArray = getStreamId("http://myserver2.com/wecewwe.txt")
Except i am not quite sure what comes from getStreamId(), so it’s up to you to figure out what the return is if download/parse had failed there. I remember there was recent conversation viewtopic.php?f=34&t=96627 and even went to check there but what do i see - you deleted the source from there because “I modified the code successfully”… apparently not though. Don’t make our life hard here - this is a “free clinic”
Hello, it didn’t work the second url link is a txt file because I don’t know how to make it a raw file like the pastebin link so I have to make the code read the txt file and convert the contents to the url
Your second line is asking if the url variable is equal to an empty string. It will NEVER be equal to an empty string, because you just set it to the “http…” string in the previous line. You don’t want to be testing the url variable, you want to perform an http transfer from the server and see what comes back, like Enterr’s code showed you. Your two line code is not touching any server at all, it’s just setting a variable to a string and then checking whether that variable is still equal to the string.