Forum Link to URL grabber: viewtopic.php?f=6&t=3702
Was wondering if there is anything obviously wrong here. I get an error that says "the following variable contains an illegal character" and the name of the variable is the actual URL instead of replacedURL. Also, if I run the code outside of a browser so that it returns no URL the program gets to stringreplacecount, shows a 0, then exits. I'm guessing the problem is simple syntax
Code: Select all
in main.ahk
----------------------
+1::sort("time")
+2::sort("prem")
+3::sort("size")
in functions.ahk
-------------------
sort(type){
URL := getURL() ;we now have the url in the variable "URL" from the geturl code in that link I posted above
MsgBox %URL% ;this message box shows the URL correctly so it seems to be working
if (type = "time"){ ;here is where something breaks but I am not sure what
replacedURL := StrReplace(%URL%, &order=Prem, &order=time, stringReplaceCount) ;this is the line the error points to
MsgBox % stringReplaceCount ;testing here to see if it worked but we never get to this msgbox
;MsgBox % replacedURL
}
}
; getURL code is down here from the forum link above. Returns the URL when called. Seems to be working correctly.