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

Home Posts Topics Members FAQ

Really simple Question.

I think I have lost my brain, or drank too much Redbull, because I cant make
the following work.
if menu_list <> "age" OR menu_list <> "first_name" then
....
else
.......
end if

If I do this below, it works.

if menu_list <> "age" then
....
else
.......
end if

How do I this with more than one option, is it with ELSE IF ??

Kind Regards

Graham Mattingley


Jul 19 '05 #1
2 1441
You'll never get to your else, because it will always match your expression
Example1: menu_list ="age" --- it doesn't equal "first_name" so it'll do
what's in the if
Example2: menu_list="first_name" --- it doesn't equal "age" so it'll do
what's in the if
Example3: menu_list="BOB" --- it doesn't equal either, so it'll do what's in
the if.

I assume you want to use an AND

if menu_list <> "age" AND menu_list<>"first_name" then
'Example 3 would end up here
else
'Example 1 and 2 would end up here
end if
OR

if menu_list="age" OR menu_list="first_name" then
'Example 1 and 2 would end up here
else
'Example 3 would end up here
end if

"Graham Mattingley" <gr****@technocom.com> wrote in message
news:bj*******************@news.demon.co.uk...
I think I have lost my brain, or drank too much Redbull, because I cant make the following work.
if menu_list <> "age" OR menu_list <> "first_name" then
...
else
......
end if

If I do this below, it works.

if menu_list <> "age" then
...
else
......
end if

How do I this with more than one option, is it with ELSE IF ??

Kind Regards

Graham Mattingley

Jul 19 '05 #2
Thanks Tom,

I knew it would be simpleish, think I have been at the screen to long today
:-)

it is all working now :-)

Graham Mattingley

"Tom B" <sh*****@hotmail.com> wrote in message
news:#1**************@TK2MSFTNGP11.phx.gbl...
You'll never get to your else, because it will always match your expression Example1: menu_list ="age" --- it doesn't equal "first_name" so it'll do
what's in the if
Example2: menu_list="first_name" --- it doesn't equal "age" so it'll do
what's in the if
Example3: menu_list="BOB" --- it doesn't equal either, so it'll do what's in the if.

I assume you want to use an AND

if menu_list <> "age" AND menu_list<>"first_name" then
'Example 3 would end up here
else
'Example 1 and 2 would end up here
end if
OR

if menu_list="age" OR menu_list="first_name" then
'Example 1 and 2 would end up here
else
'Example 3 would end up here
end if

"Graham Mattingley" <gr****@technocom.com> wrote in message
news:bj*******************@news.demon.co.uk...
I think I have lost my brain, or drank too much Redbull, because I cant

make
the following work.
if menu_list <> "age" OR menu_list <> "first_name" then
...
else
......
end if

If I do this below, it works.

if menu_list <> "age" then
...
else
......
end if

How do I this with more than one option, is it with ELSE IF ??

Kind Regards

Graham Mattingley


Jul 19 '05 #3

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

Similar topics

3
by: MostlyH2O | last post by:
Hi Folks, I'm sorry if this is the wrong place to ask a really newbie question, but I can't seem to get an answer to what seems to be a simple question... What is the difference, with regard...
72
by: Mel | last post by:
Are we going backwards ? (please excuse my spelling...) In my opinion an absolute YES ! Take a look at what we are doing ! we create TAGS, things like <H1> etc. and although there are tools...
38
by: Martin Marcher | last post by:
Hi, I've read several questions and often the answer was 'C knows nothing about .' So if C knows that little as some people say, what are the benefits, I mean do other languages know more...
7
by: farseer | last post by:
Here is the scenario: I have an interface which defines get methods for data that will make up a row in a table. However, the source of this data may, over time, switch/change (The company may...
59
by: Alan Silver | last post by:
Hello, This is NOT a troll, it's a genuine question. Please read right through to see why. I have been using Vusual Basic and Classic ASP for some years, and have now started looking at...
131
by: pemo | last post by:
Is C really portable? And, apologies, but this is possibly a little OT? In c.l.c we often see 'not portable' comments, but I wonder just how portable C apps really are. I don't write...
8
by: Sonnich | last post by:
Yes it can. All I want is a number formated as: 1234567,89 - plain numbers and a comma as decimal marker. formatnumber returns the number in american style, which is of no use. The format...
14
by: dba_222 | last post by:
Dear experts, Again, sorry to bother you again with such a seemingly dumb question, but I'm having some really mysterious results here. ie. Create procedure the_test As
17
by: Chris M. Thomasson | last post by:
I use the following technique in all of my C++ projects; here is the example code with error checking omitted for brevity: _________________________________________________________________ /*...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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,...
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: 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 ...

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.