Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Integer in edit box
11-20-2009, 03:39 AM
Post: #1
Integer in edit box
I have an integer variable

The number is 543

But when I try to put it in an edit box, it says that the types are incompatible, I've never had such a problem when doing the same thing in VB before.

How do I temporarily convert an integer to a string, is there a function for it or is it a lengthy process?
Find all posts by this user
Quote this message in a reply
11-20-2009, 03:47 AM
Post: #2
RE: Integer in edit box
You need to convert from integer to string like this :
Code:
Edit1.Text:=inttostr(integer_variable);
Also when you are converting from string to integer, you do this like :
Code:
integer_variable:=strtoint(Edit1.Text);
But you need to watch while doing this, because that could be incompatible and you can get error if value in Edit1.Text is not integer number !

There's a fine line between genius and insanity. I have erased this line.
Oscar Levant
There's a fine line between an administrator and black hat hacker. I have erased this line.
Dr DEBCOL
Visit this user's website Find all posts by this user
Quote this message in a reply
11-20-2009, 03:50 AM (This post was last modified: 11-20-2009 03:50 AM by drdebcol.)
Post: #3
RE: Integer in edit box
Very informative, DrDebcol thanks alot, I really needed this.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


 Quick Theme: