String str1 = str & i possible?

Posted on 2006-05-23
Last Modified: 2010-04-23

I want to do something like this here:

Dim str1, str2, str3, str4, str5, i

for i = 0 to 4
str & (i+1) = "Test"

In the real app I'm not filling the strings with the same values!
I just want to be able to have str1 as str(i+1) ...



Question by:Ruttensoft
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    better would be to have the str defined as array...
    but I guess you have something more complex in mind?
    LVL 9

    Accepted Solution

    You should use arrays instead
    try this:

    dim str(5) as string
    dim i as integer

    for i = 0 to 4
       str(i) = "Test"

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
    1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now