473,473 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Help with IF ELSE

Just trying to display different wording depending on reference put in.
Got it to work ok when it was just ABC then 123, otherwise 789, but now
have to add a second IF and am getting errors. Could someone advise
where I'm going wrong please?

If its ABC or DEF then put 123
If its GHI or JKL then put 456
otherwise put 789
<%If UCase(Left(msHeader,3)) = "ABC" or UCase(Left(msHeader,3)) =
"DEF" Then %>
<i> 123 </i>
<% Else %>
<% if UCase(Left(msHeader,3)) = "GHI" or UCase(Left(msHeader,3)) =
"JKL" Then %>
<i> 456 </i>
<% Else %>
<i> 789 </i>
<% End If %>

Mar 20 '06 #1
3 1577
VK

Jules wrote:
Just trying to display different wording depending on reference put in.
Got it to work ok when it was just ABC then 123, otherwise 789, but now
have to add a second IF and am getting errors. Could someone advise
where I'm going wrong please?

If its ABC or DEF then put 123
If its GHI or JKL then put 456
otherwise put 789
<%If UCase(Left(msHeader,3)) = "ABC" or UCase(Left(msHeader,3)) =
"DEF" Then %>
<i> 123 </i>
<% Else %>
<% if UCase(Left(msHeader,3)) = "GHI" or UCase(Left(msHeader,3)) =
"JKL" Then %>
<i> 456 </i>
<% Else %>
<i> 789 </i>
<% End If %>


Wrong newsgroup. Ask at <microsoft.public.scripting.vbscript>

Mar 20 '06 #2
Thanks, have removed my post

Mar 20 '06 #3
VK wrote on 20 mrt 2006 in comp.lang.javascript:
Jules wrote:
Just trying to display different wording depending on reference put
in. Got it to work ok when it was just ABC then 123, otherwise 789,
but now have to add a second IF and am getting errors. Could someone
advise where I'm going wrong please?

If its ABC or DEF then put 123
If its GHI or JKL then put 456
otherwise put 789
<%If UCase(Left(msHeader,3)) = "ABC" or UCase(Left(msHeader,3)) =
"DEF" Then %>
<i> 123 </i>
<% Else %>
<% if UCase(Left(msHeader,3)) = "GHI" or UCase(Left(msHeader,3)) =
"JKL" Then %>
<i> 456 </i>
<% Else %>
<i> 789 </i>
<% End If %>


Wrong newsgroup. Ask at <microsoft.public.scripting.vbscript>


better? : <microsoft.public.inetserver.asp.general>

btw, you should use "elseif" [or "case"]

<i><%

temp = UCase(Left(msHeader,3))
If temp = "ABC" or temp = "DEF" Then

%>123<%

Elseif temp = "GHI" or temp = "JKL" Then

%>456<%

Else

%>789<%

End If

%></i>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Christo | last post by:
borland c++ 5.01 character constant must be one or two characters long get this when compiling my first c++ program can anyone out there help? it is highlighting this line as the problem ...
2
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at...
2
by: Ernst Berg | last post by:
Thankfully there is a C language group! Hello! I am a hobyist who is rediscovering writing C programs on Linux. I use GCC and I am at a loss as to why the compile fails to find the...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
23
by: casper christensen | last post by:
Hi I run a directory, where programs are listed based on the number of clicks they have recieved. The program with most clicks are placed on top and so on. Now I would like people to be apple to...
0
by: samjam | last post by:
Below is some coding in a program i am using, i would like to know how i can get the text bigger or bolder on my webpage, This is the section of text i would like bigger or bolder (This is a very...
22
by: Amali | last post by:
I'm newdie in c programming. this is my first project in programming. I have to write a program for a airline reservation. this is what i have done yet. but when it runs it shows the number of...
2
by: cJ500 | last post by:
I can't figure out the problem with this code. I'm using a Borland compiler. The problem is with the / operation overload. When I call isNeg it doesn't output true or false. Now I know this code...
9
by: pic078 via AccessMonster.com | last post by:
I need serious help - I have a frontend/backend Access database (2 MDE Files) that remains stuck in task manager after exiting the application - you can't reopen database after exiting as a result...
6
by: priyajohal | last post by:
#include<fstream.h> #include<process.h> #include<stdlib.h> #include<conio.h> #include<string.h> #include<dos.h> #include<ctype.h> #include<stdio.h> void setup() void help();
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.