Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 13th, 2005, 6:24 PM   #1
Intimidat0r
Hobbyist Programmer
 
Intimidat0r's Avatar
 
Join Date: May 2005
Location: Don't know, but the padded walls are a nice touch.
Posts: 126
Rep Power: 0 Intimidat0r is an unknown quantity at this point
Send a message via ICQ to Intimidat0r Send a message via AIM to Intimidat0r Send a message via MSN to Intimidat0r Send a message via Yahoo to Intimidat0r
regarding the ubound function

Okay so Im trying to do this:

Public C As Integer
Public Functions As String

For C = 0 To Ubound(Functions)
     'Do code and stuff
Next

and it compiles nicely but when i run it it flags the line that calls Ubound() (the definition of the For loop or whatever it's called) and it says:

Quote:
System.ArgumentNullException
Value cannot be null
I kind of know what this means but I just started using VB.NET because Im used to C and PHP mostly (OSS LAMP stuff) so can somebody tell me how i can fix this problem? thanks.
__________________
Children in the dark cause accidents, and accidents in the dark cause children.

http://www.ronincoders.org
Intimidat0r is offline   Reply With Quote
Old Jul 13th, 2005, 9:27 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
I don't know .NET myself, but I would have to ask, "What are you expecting the value of "Functions" to be?". You haven't set it to anything that I can see.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Jul 14th, 2005, 10:24 AM   #3
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,475
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
The value for the "Functions" string cannot be NULL, blank, etc... this will more than likely break the Ubound function and cause the error that you listed. Try assigning a value to the "Functions" string and giving it another go.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Jul 15th, 2005, 11:04 AM   #4
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Functions isn't an array - it doesn't have a UBound. Try For C = 0 To Functions.Length - 1 instead.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Aug 1st, 2005, 2:59 PM   #5
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
Ah you're being far to complex and subtle for VB.

Pretend Strings don't exist, and declare it as an array of type Char or Byte.

Or better still use C.
Rory is offline   Reply With Quote
Old Aug 1st, 2005, 3:54 PM   #6
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
I would guess he was looking for a solution to his problem, rather than a redirection in his career path or tools or a way to sneak past his problem voodoo-wise. It isn't invariably necessary to initialize things in every language extant, but it often is. VB is more strongly typed than, say, Javascript. I suspect that the solutions, proposed a couple weeks ago, fixed 'im up, one way or another.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:16 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC