Variable Type ... Integer/String/Double?

# Thread: Variable Type ... Integer/String/Double?

1. Senior Member
Join Date
Dec 1969
Posts
111

## Variable Type ... Integer/String/Double?

Here is my little delema.<BR>&#060;%<BR>intYear = 2004<BR>intYear1 = intYear / 4<BR>%&#062;<BR>&#060;%=intYear1%&#062; ... result returned is 501<BR>&#060;%=VarType(intYear1)%&#062; ... result returned is 5<BR><BR>The VarType return should not be 5(which is a double) it should be 2(which is an integer). Any idea why I keep getting 5 instead of 2 and any ideas on how to correct this problem?

2. Senior Member
Join Date
Dec 1969
Posts
2,885

## RE: Variable Type ... Integer/String/Double?

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vsidxarithmetic.asp

3. Senior Member
Join Date
Dec 1969
Posts
111

## RE: Variable Type ... Integer/String/Double?

Thanks a ton. Didn&#039;t know that there were two different types of division.

4. Senior Member
Join Date
Dec 1969
Posts
111

## RE: Variable Type ... Integer/String/Double?

Actualy on further looking that is not what I am looking for. I don&#039;t need to have an integer returned I need to know if what is returned is an integer. Using the "\" division indtead of the "/" division won&#039;t work.

5. God
Senior Member
Join Date
Dec 1969
Posts
18,177

## Curious as to..

.. why it matters?

6. Senior Member
Join Date
Dec 1969
Posts
111

## RE: Curious as to..

Writing a leap year function. Need to know if the current year divided by four is an integer or not.

7. Senior Member
Join Date
Dec 1969
Posts
497

## try MOD()

mod ~ modulo, or the remainder after division.<BR><BR><BR>if year mod 4 = 0 then &#039;it is a leap year<BR><BR>Sponge

8. Senior Member
Join Date
Dec 1969
Posts
2,885

## RE: Curious as to..

Then you need the MOD function!

9. God
Senior Member
Join Date
Dec 1969
Posts
18,177

Skip the math!<BR><BR>Dim iYear, bLeapYear<BR> iYear = 2004<BR> bLeapYear = (Month(DateSerial(iYear, 2, 29)) = 2)

10. Senior Member
Join Date
Dec 1969
Posts
497

## Or...isDate("2/29/" & year(date())) <eop>

.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•