+ Reply to Thread
Results 1 to 4 of 4

How to loop with a String Variable

  1. #1
    Registered User
    Join Date
    06-19-2007
    Posts
    6

    Expert Needed: How to loop Need Help With String Variable

    Expert Needed: How do you in a loop or with an array go from

    Please Login or Register  to view this content.
    to this, without copying and pasting and changing variable1..2..3.4..5
    Please Login or Register  to view this content.
    I am trying to create a loop or an array which instead of copying and paste the bottom line and code and making Variable1 to Variable 2 and VariableDbl1 to VariableDbl2. The thing which I was having a problem was is how to increment a String or make a variable with an incremented value after it. Any thoughts?

    I had to do Dim Variable1 as String, then convert it to double afterwards, because or else it would give me a Compile error: ByRef argument type mismatch.
    Instead of making a 5 of these:

    Thanks in advanced
    Last edited by game; 06-19-2007 at 03:00 PM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    What does ibrd do? Where do the variables get assigned? What gets assigned to the variables? What determines the output positions?

    Perhaps a sample file showing more detail and some sample data with the expected output would clarify...


    rylo

  3. #3
    Registered User
    Join Date
    06-19-2007
    Posts
    6

    Error

    Sorry about the confusion. What I need help with are arrays. It doesn't seem to work.

    Please Login or Register  to view this content.
    Gives me an Run-time error '13' Type Mismatch
    Any help
    Thanks

    The other functions such as ibwrt go to a different module which is from national instruments template on reading and writing from their serial port. It gets the value and puts it in Call ibrd(udDevice, ValuetobeStored) here labeled as Variable2. I am trying to make a for loop to read this value 5 times.

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    Your types are mismatched. Removing the CDbl will fix that.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1