leuce Posted April 22, 2007 Share Posted April 22, 2007 (edited) G'day everyoneHow can I do division and make AutoIt ignore the remainder?I want to download URLs in the formhttp://foo.com/1.htmlhttp://foo.com/31.htmlhttp://foo.com/61.htmlhttp://foo.com/91.htmlhttp://foo.com/121.html etcI ask the user what the total number is (say, 127). Now I want AutoIt to calculate 127 / 30 (ignore remainder) + 1 = 5, so that I can write a for/next type of script that loops only 5 times (not 127 times):How can I do this?I've tried to do it this way:$j = 0 For $i = 1 to $num If $j = 30 Then InetGet ("http://foo.com/" & $i & ".html", "foo" & $i & ".html", 1, 0) $j = 0 Else $j = $j + 1 EndIf Nextbut that doesn't seem to work as well as I had hoped (it's very slow).Any ideas? Thanks!Samuel Edited April 22, 2007 by leuce Link to comment Share on other sites More sharing options...
Developers Jos Posted April 22, 2007 Developers Share Posted April 22, 2007 Int(127 / 30) + 1 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 More sharing options...
Private Posted April 22, 2007 Share Posted April 22, 2007 You could try an use cases Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now