Results 1 to 2 of 2

Thread: convert string to byte?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091
    hi,

    This is probably an easy one for you.. How can I convert the following string:

    k0

    To a byte and ignore the "k"? so that all I get is a byte of 0?

    Thanks,

    dan

  2. #2
    Lively Member
    Join Date
    Oct 2000
    Location
    Chicago
    Posts
    97

    Here it is.....

    Hi,
    Here is the code for doing that

    Dim bVar As Byte
    sVal = "K0"
    bVar = CByte(Right(sVal, 1))

    This code holds good if there is only 1 digit beside K,if there are 2 digits then change 1 to 2 if 3 then change to 3 etc...in the above code.
    Hope this helps you

    Good Luck

    Anil

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