Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 23rd, 2003, 08:51 AM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default Variable Differences

Hello Everyone and thanks for your help in advance. I am working on a file browser from an ASP.Net page. When I come across examples of recursing through the files in a directory, most of the examples have something like:

Dim Files() As String
Files = Directory.GetFiles(myDirectory)

My question is, what is the difference between:

Dim Files As String and Dim Files() As String

It appears that Files() is some sort of array, but I am not clear on this. Any insight on this owuld be greatly appreciated. Thanks.

  #2 (permalink)  
Old December 30th, 2003, 12:16 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Well, you can declare an array of any object. Despite it's name, "Files" is a single string whereas "Files()" is an array of strings. Simply put, you should be able to give any variable the trailing () and create an array of them.

Here's the thing that will really twist your noodle:

What's the difference between

    Dim Files() As String
        and
    Dim Files As String()

They do the same thing but I've always wondered if there is a difference. Perhaps it's just a flexibility in VB of where you can specify the variable as an array. It's frankly a poor "feature" because using the "String()" kind of implies a constructor. When used in this case, it certainly isn't one.

Peter
------------------------------------------------------
Work smarter, not harder.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XML differences mrame XSLT 4 October 6th, 2008 07:34 AM
mozilla/IE 7 differences Adam H-W CSS Cascading Style Sheets 2 July 9th, 2007 04:16 AM
Code differences afharris_83 BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 5 May 8th, 2007 10:14 AM
Xcode 2.4 differences craigontour Xcode 1 November 24th, 2006 11:08 PM
objDataAdapter Differences cpbittner BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 1 September 20th, 2004 08:09 PM



All times are GMT -4. The time now is 05:50 AM.


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