Jump to content

# If x is a multiple of y then...

## Recommended Posts

How to: If x is a multiple of y then...

I've spent atleast 1.5 hours looking for an answer. Searching is just not wokring! An answer would be greatly appreciated!

Like for multiples of 5...

if X = 10 then Multiple=true

if X = 14 then Multiple=false

if X = 15 then Multiple=true

#### Share this post

##### Share on other sites

How to: If x is a multiple of y then...

I've spent atleast 1.5 hours looking for an answer. Searching is just not wokring! An answer would be greatly appreciated!

Like for multiples of 5...

if X = 10 then Multiple=true

if X = 14 then Multiple=false

if X = 15 then Multiple=true

_MathCheckDiv

Checks if NumA is divisable by NumB

#### Share this post

##### Share on other sites

thank you very much for the quick responce - this will work =)

but for reference isn't there something like calle "mod" or that uses a % sign?? I remember it from long ago and don't know if it was AI or not...

#### Share this post

##### Share on other sites

thank you very much for the quick responce - this will work =)

but for reference isn't there something like calle "mod" or that uses a % sign?? I remember it from long ago and don't know if it was AI or not...

Do you not have a copy of the help file? If you look up "Mod", you find... wait for it... "Mod"!

Quoting from the mysteriously missing help file:

Mod

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

Performs the modulus operation.

Mod ( value1, value2 )

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

#### Share this post

##### Share on other sites

lol I saw that but I'm no good with math and it made no sense to me... I didn't get how I was supposed to use it >.<

And even now I'm not sure... I'm guessing it works like NumA and NumB for the one that's in Math.au3?

#### Share this post

##### Share on other sites

lol I saw that but I'm no good with math and it made no sense to me... I didn't get how I was supposed to use it >.<

And even now I'm not sure... I'm guessing it works like NumA and NumB for the one that's in Math.au3?

If Mod(x, 5) = 0 Then

Edit:

Just so you have a working example to see how it works:

For \$i = 1 To 100
If Mod(\$i, 5) = 0 Then ToolTip("Current count by five: "& \$i, 0, 0)
Sleep(100)
Next
Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

#### Share this post

##### Share on other sites

Thanks! I love you guys

## 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

×

• Wiki

• Back

• Git