Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

if else on type of interger
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



Report this thread to moderator Post Follow-up to this message
Old Post
Simon
10-22-04 01:55 PM


Re: if else on type of interger
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/e...ml/vsoprmod.asp

Ray at work





"Simon" <simon.cornforth@blueyonder.co.uk> wrote in message
news:rs6ed.133939$BI5.19749@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
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Ray Costanzo [MVP]
10-22-04 01:55 PM


Re: if else on type of interger
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.



Report this thread to moderator Post Follow-up to this message
Old Post
Dave Anderson
10-22-04 08:55 PM


Re: if else on type of interger
Oh yeah.  Thanks.  :]

Ray at work

"Dave Anderson" <GTSPXOESSGOQ@spammotel.com> wrote in message
news:uXWC0BEuEHA.948@tk2msftngp13.phx.gbl...
> Ray Costanzo [MVP] wrote: 
>
> 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.
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Ray Costanzo [MVP]
10-22-04 08:55 PM


Re: if else on type of interger
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





Report this thread to moderator Post Follow-up to this message
Old Post
Simon
10-22-04 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

ASP archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 03:59 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.