Jump to content

How to ignore remainders in maths


 Share

Recommended Posts

G'day everyone

How can I do division and make AutoIt ignore the remainder?

I want to download URLs in the form

http://foo.com/1.html

http://foo.com/31.html

http://foo.com/61.html

http://foo.com/91.html

http://foo.com/121.html etc

I 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

Next

but that doesn't seem to work as well as I had hoped (it's very slow).

Any ideas? Thanks!

Samuel

Edited by leuce
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...