Results 1 to 6 of 6

Thread: Question regarding int -> string conversions

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Posts
    25

    Question

    How would I go about converting an integer (say it has a value of 65) to the corresponding value in a string(yea, I actually want A out of this just one character. Or would this value have to be a byte in order to make the conversion?

    regardless, what command do I need to use

    Mark Wight
    x86 ASM, AS11 ASM, C, C++, Java.

  2. #2
    Member
    Join Date
    Nov 2000
    Location
    Brisbane, Australia
    Posts
    44

    Int to string

    Assuming you want 65 to be converted to an "A":

    Chr(65)

    Done.
    Boring signature included.

    VB6 SP3.

  3. #3
    Guest
    Chr$(65) = "A"

    ...and...

    Asc("A") = 65

    ...if that's what you're looking for.


    Paul

  4. #4
    Guest
    Chr() returns a Variant and Chr$() returns a string. The difference is that Chr$ is slightly faster.

  5. #5
    Member
    Join Date
    Nov 2000
    Location
    Brisbane, Australia
    Posts
    44
    I've read in other threads that adding the "$" as in Chr$ means Chr As String.

    I'm a bit of a newbie, so can you answer this for me - does this only work with certain functions, or can this be used for any?
    Boring signature included.

    VB6 SP3.

  6. #6
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    No, not all functions have the ability to return strings.
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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