Results 1 to 2 of 2

Thread: More fun with strings

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Posts
    25

    Wink

    okiee am using the following style code to take in some input from the standard serial control.

    Code:
    'temp would be a string
    Temp = mscomm1.input
    
    'Global String starts off 0ed out
    GlobalString = GlobalString + Temp
    Now for my question

    I have my external hardware device sending in some input at an interval of .5 seconds, I then am building a 17 character string from it, and using that string.

    My problem would be that the device is running 24/7 regardless if vb cares about it or not, and it picks up half way through the series of characters and ends up giving me a jumbled string. Optimally I want to get in
    A12345678912345 <- GlobalString

    however I usually end up with something like

    2345A1234567891 <- Mucked up global

    So what would be a method to cut out the string so I can get the "A" to get at the beginning once it is read in. And continue to read in the. The tricky bits The position of A is never in the same loctaion, so any quick n dirty solutions for me (well if its a bit sadistic I can handle that too )

    thx in advance
    Mark Wight
    x86 ASM, AS11 ASM, C, C++, Java.

  2. #2
    Hyperactive Member theman32x's Avatar
    Join Date
    May 2000
    Location
    New Jersey, USA
    Posts
    305
    how about instead of:

    GlobalString = GlobalString + Temp

    you put:

    GlobalString = GlobalString & Temp

    or

    making variables to hold each temp that you get and add it all together:

    GlobalString = a & b & c ....


Posting Permissions

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



Click Here to Expand Forum to Full Width