By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,510 Members | 1,430 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,510 IT Pros & Developers. It's quick & easy.

if else on type of interger

P: n/a
Hi there

I know I should be able to do this, but I'm stuck!

I am trying to build a table that forms from cats being pulled from a DB.

The table will be 3 cols by x rows.

I have been doing an if else based on if int(Ident/3)= 1, 2, 3, 4 etc etc ,
but this is sloppy! :-(

What I need to get working is

<%

Code Snipped

if int(Ident/3)= [a whole number] then

%>
formatting A is done
<% else %>
formatting b is done
<%
end if

Code Snipped

%>

Thanks in advance

Si
Jul 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Perhaps you are looking for the mod[ulus] operator, although it wouldn't be
much different from what you're doing now. What exactly isn't working for
you in the way you want it to?

If Ident Mod 3 Then
'formatting a
Else
'formatting b
End If

http://msdn.microsoft.com/library/en...l/vsoprmod.asp

Ray at work

"Simon" <si*************@blueyonder.co.uk> wrote in message
news:rs********************@fe2.news.blueyonder.co .uk...
Hi there

I know I should be able to do this, but I'm stuck!

I am trying to build a table that forms from cats being pulled from a DB.

The table will be 3 cols by x rows.

I have been doing an if else based on if int(Ident/3)= 1, 2, 3, 4 etc etc
,
but this is sloppy! :-(

What I need to get working is

<%

Code Snipped

if int(Ident/3)= [a whole number] then

%>
formatting A is done
<% else %>
formatting b is done
<%
end if

Code Snipped

%>

Thanks in advance

Si

Jul 21 '05 #2

P: n/a
Ray Costanzo [MVP] wrote:
If Ident Mod 3 Then
'formatting a
Else
'formatting b
End If


That ought to be:

If Ident Mod 3 = 0 Then
^^^^^
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 21 '05 #3

P: n/a
Oh yeah. Thanks. :]

Ray at work

"Dave Anderson" <GT**********@spammotel.com> wrote in message
news:uX*************@tk2msftngp13.phx.gbl...
Ray Costanzo [MVP] wrote:
If Ident Mod 3 Then
'formatting a
Else
'formatting b
End If


That ought to be:

If Ident Mod 3 = 0 Then
^^^^^
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message.
Use
of this email address implies consent to these terms. Please do not
contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.

Jul 21 '05 #4

P: n/a
Excellent, Thanks for that.

I worked around it by doing

if int(Ident/cellCount) - Ident/cellCount = 0 then

which worked, but .... now

RowBreak = Ident Mod cellCount

if RowBreak = 0 then

Works and is a lot cleaner

Thanks again.

Si


Jul 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.