Results 1 to 3 of 3

Thread: int to string??

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    7
    Hi to All! Suppose that I want to show in a label the value of an int
    variable, how can I do that? When I try to assign the int as the argument of
    the setText method of the Label the compiler complains and argues that they
    are not convertible types. What can I do?

    Thanks
    Things must be easy, but not easier than they are.

  2. #2
    Lively Member
    Join Date
    Sep 2000
    Location
    Singapore
    Posts
    78
    Use this function if I still remember correctly:

    toString(int)

  3. #3
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    292
    myLabel.setText("" + myInt);

    When the compiler see's you are trying to join an int to a String it will autimatically call the right method to convert.
    "People who think they know everything are a great annoyance to those of us who do."

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