473,434 Members | 4,837 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,434 software developers and data experts.

What is equivalent to vb’s IIF for C#?

hello can someone tell me how to accomplist IIF in C# thanks!
Nov 19 '05 #1
3 128312
you can do it like this: -

if a evaluates to 1 then the expression returns true, false otherwise

a == 1 ? true : false

regards
Joyjit

"Asha" <As**@discussions.microsoft.com> wrote in message
news:EA**********************************@microsof t.com...
hello can someone tell me how to accomplist IIF in C# thanks!

Nov 19 '05 #2
"Joyjit Mukherjee" <jo**************@hotmail.com> wrote in message
news:eH**************@TK2MSFTNGP14.phx.gbl...
you can do it like this: -

if a evaluates to 1 then the expression returns true, false otherwise

a == 1 ? true : false

regards
Joyjit

"Asha" <As**@discussions.microsoft.com> wrote in message
news:EA**********************************@microsof t.com...
hello can someone tell me how to accomplist IIF in C# thanks!


To suppliment Joyjit's comment, the documentation for this is at
http://msdn.microsoft.com/library/de...aloperator.asp

Nov 19 '05 #3
object o;

o = (cond1 = cond2 ? truevalue : falsevalue);

Basically,

<bool condition> ? <true value> : <false value>;

Hope this helps

Ashton
"Asha" <As**@discussions.microsoft.com> wrote in message
news:EA**********************************@microsof t.com...
hello can someone tell me how to accomplist IIF in C# thanks!

Nov 19 '05 #4

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

Similar topics

14
by: John | last post by:
Is there an equivalent of COM on Linux that I can get through Python. My need is to have some sort of language independent component framework. I can think of CORBA but I have to have a server...
86
by: Michael Kalina | last post by:
Because when I asked for comments on my site-design (Remember? My site, your opinion!) some of you told me never to change anything on font-sizes! What do you guys think of that:...
6
by: Frank Rachel | last post by:
So I can focus on the correct areas of research, I was wondering if someone could give me the .NET equivelents for this J2EE architecture: JSP's make calls to local JavaBean Controls. The...
7
by: ben | last post by:
hello, an algorithm book i'm reading talks about the connectivity problem/algorithm. it gives a number of examples where the connectivity problem applies to real life situations (like, the...
11
by: Kobu | last post by:
Hi, I've gotten into the habit of mentally converting big expressions to parse tress (started doing this after reading some c.l.c posts on parse trees). Can someone verify if the following...
11
by: JS | last post by:
In K&R I have found this: static char allocbuf; static char *allocp = allocbuf; But *allocp has not been set to point at anything yet so how is it possible to make the contents of an unknown...
9
by: Paul Brownjohn | last post by:
Hello I am new both to this group and to C# programming having spent the last 15 years or so writing C and VB. You will forgive I hope if I am asking the totally obvious but it is a question...
8
by: Xucyr | last post by:
I can't find any "short" code to make this work without taking 100s of lines (because I have to keep repeating this process several times). But this is what I have so far: int i = 7; do {...
14
by: grid | last post by:
Hi, I have a certain situation where a particular piece of code works on a particular compiler but fails on another proprietary compiler.It seems to have been fixed but I just want to confirm if...
28
by: gnuist006 | last post by:
I have some code like this: (if (test) (exit) (do something)) or (if (test)
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
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
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
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
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?

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.