473,406 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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
Jul 21 '05 #1
4 1272
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
by: Timothy Madden | last post by:
Hello I've read here that only C language has a standard 64bit integer. Can you please tell me what are the reasons for this ? What is special about C language ? Can you please show me some...
2
by: Sam Sungshik Kong | last post by:
Hello! I studied C# a little bit and am trying to compare it with VB.Net. There's 'Option Strict' in VB.Net. I thought that if I turn it on, it is as strict as C# when checking types. See...
1
by: steellock | last post by:
The below code always get compile error, "Can not change Interger to UInt32". Then How to set the BackColor property With TextObjec .Name = "txtProductCode .SetText("Apple" .BackColor = 8 '...
2
by: Jim in Arizona | last post by:
I'm learning form an ASP.NET 1.0 book and I tried out some code that returns this error: Compiler Error Message: BC30311: Value of type 'Integer' cannot be converted to...
1
by: neeraj | last post by:
Hi All Can any give me the code for convert "DataColumn" data type of "DataTable". Even if data table already populated (have data) Actually I am creating one search module which searches the...
13
by: william | last post by:
code segment: long int * size; char entry; ............. size=&entry; ************************************* Gcc reported 'assignment of incompatible pointer type'.
2
by: William Manley | last post by:
Is there a way to check if a string can be a interger without crashing the program?
40
by: KG | last post by:
Could any one tell me how to reverse the bits in an interger?
1
by: www.phpbasic.com | last post by:
i have a problem with interger number in PHP <?php class read{ var $num; function read($num){ $this->num = $num; } function basic(){ print "NUM: ".($this->num); }
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.