Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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 June 19th, 2010, 06:04 PM
Registered User
 
Join Date: Jun 2010
Posts: 5
Thanks: 4
Thanked 0 Times in 0 Posts
Default General question about VB.Net

I've noticed, through many examples in the book, that some methods are declared with methodname(). When entering these, intellisense can often insert the name for you, but never seems to include the parentheses. I've tried a few both ways and it doesn't seem to make any difference.

My question is, are there situations where you must enter the parentheses (obviously function calls I guess)? How do you know when it's optional and when it's not?

Thanks..
 
Old June 20th, 2010, 02:23 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

The compiler gives you an error when they are required ;-)

I do a lot of C# where they are always required, so I always type them in VB. I think they are at least optional when calling a parameterless method. E.g.:

MethodName

instead of

MethodName()

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
General question about VB 2005 imagetvr Visual Basic 2005 Basics 3 February 9th, 2008 02:24 PM
General Question About c++ madeebmir C++ Programming 0 August 15th, 2006 10:48 AM
Very general question merianos VB How-To 4 August 1st, 2006 12:24 PM
VB.Net question on Windows VB.Net datagrids dmsousa VS.NET 2002/2003 1 January 19th, 2005 02:45 PM
General Question stu9820 ASP.NET 1.0 and 1.1 Basics 2 September 23rd, 2003 03:36 PM





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