Results 1 to 3 of 3

Thread: problem with automatic count

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    problem with automatic count

    how to put automatic count?

    this is my code:

    VB Code:
    1. calc_pm = "1e0010230014000d1004000100"
    2. last_pm = "000000000000000000560140"
    3.  
    4. xor_pm = XorHex(calc_pm & "00" & last_pm)
    5.  
    6. FT_RES = SendToDevA(calc_pm & "00" & last_pm & xor_pm, &H1)
    7.  
    8. cH = ""
    9.     For i = 34 To UBound(FT_In_Buffer)
    10.         cH = cH & Chr$(FT_In_Buffer(i))
    11.     Next i
    12.     ConvThisText = cH
    13.     ConvToHex ConvThisText
    14.     cH = ConvThisText
    15.    
    16. pm0 = cH

    you will see the "00" after the string readed from pm0 = cH
    need to change immedietely the "00" into "01" and save into new string perform again.. "01" change into "02" and save it in another string.. up to 10

  2. #2
    Frenzied Member
    Join Date
    Oct 2003
    Posts
    1,301

    Re: problem with automatic count

    Where does that "00" come from?

    Use Format(counter, "00") to format a number into a two digit string.
    COunter is a variable that you increment by 1 every time you go through this function.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: problem with automatic count

    what you mean sir?

    this one?

    VB Code:
    1. Dim counter as integer
    2.  
    3. Text1.Text = Format(counter, "00")

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