Sign in to follow this  
Followers 0
tutor2000

Strange UrlDownload behavior

5 posts in this topic

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


Only $2.00 with Resale Rights How to Block Better for Martial Artists and NonMartial Artistshttp://kirkhamsebooks.com/MartialArts/Bloc...tterEbook_m.htm

Share this post


Link to post
Share on other sites

$ini="a.ini"

do

until stringinstr($ini,".ini")

this is working so can be a problem in your side. Which version of AutoIt are you using? :ph34r:

Share this post


Link to post
Share on other sites

this is working so can be a problem in your side. Which version of AutoIt are you using? :ph34r:

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


Only $2.00 with Resale Rights How to Block Better for Martial Artists and NonMartial Artistshttp://kirkhamsebooks.com/MartialArts/Bloc...tterEbook_m.htm

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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


Only $2.00 with Resale Rights How to Block Better for Martial Artists and NonMartial Artistshttp://kirkhamsebooks.com/MartialArts/Bloc...tterEbook_m.htm

Share this post


Link to post
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
Sign in to follow this  
Followers 0