×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Naming arrays with for loop?

Naming arrays with for loop?

Naming arrays with for loop?

(OP)
Dim MainArray(999,3)

Dim i As integer
For i = 1 to partcount

Set MainArray(i-1,0) = products1.Item(i) 'The first row of the MainArray consists of the products of the PPR

Next

Dim P0(11)
MainArray(0,0).Position.GetComponents P0 'Using the GetComponents method an array named P0 is created and contains the coordinates of the product MainArray(0,0)

MainArray(0,1)=P0(9)
MainArray(0,2)=P0(10)
MainArray(0,3)=P0(11)

This is a part of my code that works fine, but i want it to work
From P0 to P(partcount) and i wonder if i can use a for loop at the name of the array?

Something like that:

For i=1 To partcount

Dim P"i"(11)
MainArray(i,0).Position.GetComponents P"i"

MainArray(i,1)=P"i"(9)
MainArray(i,2)=P"i"(10)
MainArray(i,3)=P"i"(11)

Next

Any help or alternative choice would be very helpful!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources