|
-
Nov 22nd, 2002, 05:57 PM
#1
Thread Starter
Addicted Member
Why doesn't this array thing work?
VB Code:
Dim FData() As String
ReDim FData(0) As String
ReDim FData(0, 0) As String
FData(0) = "ABC"
Can't I put text in the first level of this multi-dimentional array?
-
Nov 22nd, 2002, 06:04 PM
#2
Since you ReDimmed it to a two dimensional array...... you have to specify where the data goes. FData(0,0)
-
Nov 22nd, 2002, 06:10 PM
#3
Thread Starter
Addicted Member
Wait a sec...
This isn't making sense to me!
In php you can assign data into FData[0]. I thought this would also be possible in VB! Because if I put FData[0,0] = "ABC", then FData[0] is empty. but i wanted to have a database structure type of multidimentional array!
-
Nov 22nd, 2002, 06:18 PM
#4
Frenzied Member
VB Code:
Dim FData() As String
FData(0) = "ABC"
FData(1) = "DEF"
FData(2) = "HIJ"
And so on, : Or am i loosin the point of what u wanna do, but u dont have to re-dim it,
-
Nov 22nd, 2002, 06:24 PM
#5
Originally posted by INF3RN0666
In php you can assign data into FData[0]. I thought this would also be possible in VB!
Assumption incorrect (like that anyway)
-
Nov 22nd, 2002, 06:28 PM
#6
Frenzied Member
Oh a little addition to wot i sed above:
VB Code:
Dim FData() As String
FData(0) = "ABC"
FData(1) = "DEF"
FData(2) = "HIJ"
' Array's take up memory etc, so u need to erase it AFTER you are DONE
' IE: msgbox FData(0)
Erase FData()
-
Nov 22nd, 2002, 06:47 PM
#7
Thread Starter
Addicted Member
so i cant assign anything to the first level of the array? That's dumb if it's true!
-
Nov 22nd, 2002, 06:55 PM
#8
You can do:
VB Code:
Dim Arr(5,1) As String
Arr(0,0) = "ABC"
Arr(0,1) = "DEF"
Arr(1,0) = "HIJ"
Arr(1,1) = "KLM"
' .......
-
Nov 23rd, 2002, 10:37 AM
#9
Frenzied Member
Originally posted by INF3RN0666
so i cant assign anything to the first level of the array? That's dumb if it's true!
how do u mean by "First Level"?
VB Code:
FData() = Split("H E L L O"," ")
u can do that (im not certain if thats what u mean tho)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|