Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics 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 July 18th, 2003, 01:14 PM
Authorized User
 
Join Date: Jun 2003
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dim in VB.NET

Hello all,
I have a simple declaration on VB6 now I like to have it on VB.net how do I declare it?

Ex: dim ch as String * 1 'VB6

I am just learning VB.net so I can't make it work in VB.net
Thanks for all helps.
 
Old July 20th, 2003, 05:01 AM
Authorized User
 
Join Date: Jun 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What's the * 1 for?
I just declare it the same way in .NET as in VB6
ex. Dim strName As String 'both for VB6 and VB.NET

Hope it helps.
Lee

 
Old August 3rd, 2003, 09:54 PM
Authorized User
 
Join Date: Jun 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had the same question when I started with vb.net. I was told that you can not declare a string variable with a length. The way I handled it was to create a additional variable for the length. See the example below.

DIM strFirstName as String
DIM strFirstNameLength as integer = 30


Hope this helps,

David





Similar Threads
Thread Thread Starter Forum Replies Last Post
The origin of the "DIM" keyword RGCook BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 9 February 6th, 2009 09:03 AM
Print Preview Dim Photo mateenmohd Access 0 March 2nd, 2008 03:03 AM
Can't DIM database object egolsen Access VBA 2 September 26th, 2005 04:25 PM
Dim Types in ASP? rmwalters2000 Classic ASP Basics 2 August 11th, 2004 12:28 AM
Dim dbs As Database Brian263 Access 1 May 6th, 2004 07:11 PM





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