Wrox Programmer Forums
BOOK: Visual Basic 2005 Programmer's Reference
This is the forum to discuss the Wrox book Visual Basic 2005 Programmer's Reference by Rod Stephens; ISBN: 9780764571985
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Visual Basic 2005 Programmer's Reference 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 April 25th, 2006, 01:38 PM
Registered User
Join Date: Mar 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Use of Brackets Around Types

I have seen (in Microsoft's online help) calling methods shown with a brackted [] class name or type, as in:

    [classname or instance].method()


What is that all about, and where can I find the definition of brackets usage in VB 2005? I could not find it in your book or by search of online help.

Truman Byron Thomas
Old April 26th, 2006, 07:58 AM
Rod Stephens's Avatar
Wrox Author
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts

Usually you use brackets to differentiate a routine, property, variable, parameter or other name from a keyword. For example, you could make a parameter to a method be something like "Me" or "Overloads." Then you'd need to put brackets around it in the method declaration and everywhere you use it.

(You also use it in SQL statements if a field, table, or other name is a keyword or contains spaces.)

You can generally avoid the brackets if you pick better names.

Author of "Visual Basic 2005 Programmer's Reference"

Similar Threads
Thread Thread Starter Forum Replies Last Post
phone number brackets dhoward VB.NET 2002/2003 Basics 1 November 8th, 2006 11:58 AM
Square Brackets in Form Names dylan_b JSP Basics 1 July 11th, 2006 02:29 PM
Types DARSIN Oracle 2 February 5th, 2005 12:14 AM
What do the brackets actually do... Brettvan1 VB.NET 2002/2003 Basics 2 October 5th, 2004 09:24 AM

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