Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 13th, 2004, 12:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default IIF

Hello,

I was just curious if there is an IIF equivalent in the .NET framework? I see that IIF is supported, but was curious if they replaced it with anything, or if IIF will continue to be supported.

Thanks,

Brian
__________________
Brian
 
Old May 13th, 2004, 12:43 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Brian,

I think this is rather a language feature than a framework feature (although maybe the framework has something for it as well).

In C#, you can use ?: operator, like this:
Code:
int a = 4;
int b = 0;
b = (a == 4) ? 10 : 12;
MessageBox.Show(b.ToString());
This will display 10 when a equals 4 (as in this example), or 12 in all other cases.


I don't think there is an equal alternative in Visual Basic that provides the same short cut, other that IIF and If / Then Else statements.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: The Beautiful Ones by Prince and the Revolution (Track 3 from the album: Purple Rain) What's This?
 
Old May 13th, 2004, 02:06 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Thanks, yeah I knew IIF was VB.NET specific, I was just curious if they changed it or not.

Thanks again,

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with IIF thork1 Access 1 March 25th, 2008 06:42 AM
IIf umeshtheone Beginning VB 6 3 June 21st, 2007 12:24 AM
IIf problem Vince_421 Access 1 June 1st, 2006 11:35 AM
Query with IIF canmex Access 14 March 7th, 2006 03:07 AM
Question with iif Enoch Access 5 December 8th, 2005 04:36 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.