Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB.NET
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB.NET General VB.NET discussions for issues that don't fall into other VB.NET forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 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
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 21st, 2006, 10:24 PM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to jeff_cafm
Default 1 and 2 dimensional arrays

I'm going to try my best to explain this, so bear with me. I'm creating a parsing engine for some emails that i receive so i can more easily monitor and control the data. I've begun creating a class that parses out the information and stores the values into a public valued array so i can cycle through the info. (may not be the best idea so open to any others) but there are a total of 6 arrays. 2 of which are 2 dimensional. The problem i'm having is i need/want to store one of the 1 dimensional arrays into a 2 dimensional array. example:

oneDime(0) = "value 1"
oneDime(1) = "value 2"
oneDime(2) = "value 3"

twoDime(0,1) = "group heading"
twoDime(1,1) = "group date"
twoDime(2,1) = oneDime

They are both casted as string() arrays:
Private oneDime(2) As String
Private twoDime(,) As String <- casted this way because i do not know the total values needed so i am using ReDim Preserve to adjust as needed.

The error i'm getting is this:
Value of type '2-dimensional array of String' cannot be converted to 'String'.

Please help.



Jeff Dupont
-CAFM Developer
Reply With Quote
  #2 (permalink)  
Old April 24th, 2006, 03:05 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

What does CAFM stand for?

If the compiler were a little smarter, you could have
Code:
    twoDime(2) = oneDime
but it's not. "oneDime" is (essentially) a reference to the location of the oneDime array. That can't be stored in twoDime(2, 1), because that is essentially the address of the location of a string.
I believe you are going to have to
Code:
    For i = oneDime.GetLowerBound(0) To oneDime.GetUpperBound(0)
        twoDime(2, i) = oneDime(i)
    Loop
Reply With Quote
Reply


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
muti dimensional arrays help:( chris1012 Java Basics 6 December 22nd, 2007 01:11 PM
1 and 2 dimensional arrays jeff_cafm VB.NET 2002/2003 Basics 1 April 26th, 2006 05:02 PM
2 dimensional array venterjo General .NET 2 January 23rd, 2005 09:04 AM
Multidemmesional Arrays OR arrays gmoney060 Classic ASP Basics 3 November 1st, 2004 03:42 PM



All times are GMT -4. The time now is 01:15 PM.


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