Jump to content

Strange UrlDownload behavior


Recommended Posts

if I keep the do until in the script I'm returned an

error on the urldownload. If I ; the do until stuff

out, the url works

ww

---------------------------

dircreate(".\WebPageInfo")

dircreate(".\Url")

filedelete(".\Url\temp.txt" )

do

$ini = FileSaveDialog ( "Select Your Ini file to save

your web page info in", ".\WebPageInfo", "Or write in

a new name (*.ini)", 10 )

if @error = 1 then

exit

endif

if not (stringinstr($ini,".ini")) then

msgbox(4096,"Kirkhams Programs", "You must type

.ini after your filename")

endif

until stringinstr($ini,".ini")

sleep(100)

$ret=""

$url = "http://kirkhamsebooks.8m.com"

$ret = URLDownloadToFile ( $url, ".\Url\temp.txt" )

if $ret = 0 then

msgbox(4096,"Kirkhams Programs", "Unable to

download"&@CRLF&$url&@CRLF&"Please get your

information directly from the source with View")

endif

Link to comment
Share on other sites

  • Developers

The official release

Didn't work at work or at home

If you're using a beta should I report this as a bug?

Rick

Rick, it isn't a bug but a script issue.

The $ini = FileSaveDialog changes the current directory.

Run this code so you see what i mean.... :ph34r:

DirCreate(".\WebPageInfo")
DirCreate(".\Url")
FileDelete(".\Url\temp.txt")
do
   $INI = FileSaveDialog("Select Your Ini file to save your web page info in", ".\WebPageInfo", "Or write in a new name (*.ini)", 10)
   If @error = 1 Then
      Exit
   EndIf
   If not (StringInStr($INI, ".ini")) Then
      MsgBox(4096, "Kirkhams Programs", "You must type .ini after your filename")
   EndIf
Until StringInStr($INI, ".ini")
Sleep(100)
$RET = ""
$URL = "http://kirkhamsebooks.8m.com"
Runwait(@comspec)
$RET = URLDownloadToFile($URL, ".\Url\temp.txt")
If $RET = 0 Then
   MsgBox(4096, "Kirkhams Programs", "Unable to download" & @CRLF & $URL & @CRLF & "Please get your information directly from the source with View")
EndIf
Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Rick, it isn't a bug but a script issue.

The $ini = FileSaveDialog changes the current directory.

Run this code so you see what i mean....  :ph34r:

DirCreate(".\WebPageInfo")
DirCreate(".\Url")
FileDelete(".\Url\temp.txt")
do
   $INI = FileSaveDialog("Select Your Ini file to save your web page info in", ".\WebPageInfo", "Or write in a new name (*.ini)", 10)
   If @error = 1 Then
      Exit
   EndIf
   If not (StringInStr($INI, ".ini")) Then
      MsgBox(4096, "Kirkhams Programs", "You must type .ini after your filename")
   EndIf
Until StringInStr($INI, ".ini")
Sleep(100)
$RET = ""
$URL = "http://kirkhamsebooks.8m.com"
Runwait(@comspec)
$RET = URLDownloadToFile($URL, ".\Url\temp.txt")
If $RET = 0 Then
   MsgBox(4096, "Kirkhams Programs", "Unable to download" & @CRLF & $URL & @CRLF & "Please get your information directly from the source with View")
EndIf
Ahhhhh clever you are (in my best Yoda impression)

Thanks buddy now I can work around it by using @scriptdir or even getting the path from an ini

Rick

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...