Visual Basic Expert


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Hi,
    Thank you for the answer ,Yes I know the Rentron page ,but I have the problem with the output from my ADCIN conversion,
    sometimes is greater as 99 and sometimes smaller as 100 then I have 2 or three digit.
    But I can now test with your example, I need like in your example a fix string lenght.
    My problem was that I can not stop after the string ex. "A" the next 3 digits.

    Regard Pesti.

  2. #2
    tdavis80's Avatar
    tdavis80 Guest


    Did you find this post helpful? Yes | No

    Talking

    I think you said your string will look like so:

    A12B32C112D33

    Is that so?

    If yes, then here is a way to do it:

    dataIN = "A12B32C112D332" ' or however you get data into the PC

    start = instr(dataIN, "A") ' find the A
    stop = instr(dataIN, "B") ' find the B
    A = mid(dataIN, start+1, stop-start-1) ' everything between the A & B is A

    start = instr(dataIN, "B")
    stop = instr(dataIN, "C")
    B = mid(datain, start+1, stop-start-1)

    start = instr(dataIN, "C")
    stop = instr(dataIN, "D")
    C = mid(datain, start+1, stop-start-1)


    until the last entry

    start = instr(dataIN, "D")
    D = mid(dataIN, start+1)

    Since D is the last on the string it automatically is everything to the right of D (no Stop= parameter)

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Hi TDavis80,
    Thank you I will try now your code ,
    Thanks a lot.
    Regard Pesti

Similar Threads

  1. Sending Commands from Visual Basic about IR to Pic
    By tne_de in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th April 2009, 06:09
  2. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  3. Visual Basic 2005
    By keithdoxey in forum Off Topic
    Replies: 4
    Last Post: - 1st August 2007, 12:10
  4. PIC to serial with visual basic
    By mbw123 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 31st March 2007, 16:06
  5. Visual Basic 6 and Pic com
    By shawn in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 15th September 2005, 05:21

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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