<>0 is not working

E

eddie wang

Here are the scripts. interest is 0, but, it will not execute then
clause. Why???

interest = round(rs("CURR_WORKING_INTEREST"))
response.write interest
if sizeworkint < 3 OR interest<>0 then CURR_WORKING_INTEREST2 =
left(rs("CURR_WORKING_INTEREST"),2) + ".000000" end if
 
E

Evertjan.

eddie wang wrote on 06 jan 2004 in microsoft.public.inetserver.asp.general:
if sizeworkint < 3 OR interest<>0 then CURR_WORKING_INTEREST2 =
left(rs("CURR_WORKING_INTEREST"),2) + ".000000" end if

There are two sorts of if..then in vbs, you cannot mix them !!!

1 single line, without "end if":

if boolean then statement

2 multiline, with "end if":

if boolean then
statement
end if
 
R

Ray at

You say interest = 0 but you want your code to execute if interest does NOT
equal zero, so that's why it's not executing. Of course, I'm ignoring the
sizeworkint<3 part, because I don't know what that value is.

Ray at work
 
B

Brynn

If you want all in one line, but have more than thing happening ...
you can just

<%
If this <> "1" Then: Response.Write "Worked":
Response.Cookies("yourCookie")="1": End If
%>

I rarely see the colon used. Some say it is bad form, but I think that
it can clean up the code quite a bit. I guess it is how you use it ...
I like to make code that is both easy to read, but also easiest to
view the most of the code on my screen ... without me going to 1600 x
1200 ... lol.

I am also End If paranoid for some reason ... LOL

Brynn
 
E

Evertjan.

Brynn wrote on 07 jan 2004 in microsoft.public.inetserver.asp.general:
If you want all in one line, but have more than thing happening ...
you can just

<%
If this <> "1" Then: Response.Write "Worked":
Response.Cookies("yourCookie")="1": End If
%>

Old basic tradition allowes this:

If conditition then statement1:statement2:statement3

So, untested, I think it would be the
"Then :" that alows the End If.

Better use my first online-multi-statement form,
the one without the "end if"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,591
Members
45,100
Latest member
MelodeeFaj
Top