![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | |
|
Hobbyist Programmer
|
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
Nextand 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:
__________________
Children in the dark cause accidents, and accidents in the dark cause children. http://www.ronincoders.org |
|
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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 |
|
|
|
|
|
#3 |
|
Programming Guru
![]() ![]() ![]() |
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." |
|
|
|
|
|
#4 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Functions isn't an array - it doesn't have a UBound. Try For C = 0 To Functions.Length - 1 instead.
|
|
|
|
|
|
#5 |
|
Expert Programmer
|
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. |
|
|
|
|
|
#6 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|