|
-
Oct 21st, 2002, 02:55 PM
#1
Thread Starter
Hyperactive Member
Help
ok im getting mad errors when i do this what is the correct way to do this?
Code:
intPieces = Integer.valueOf(txtPieces.getText().valueOf());
-
Oct 22nd, 2002, 03:21 AM
#2
Addicted Member
What are the value data types? I assume (may be wrong) that you're tryiung to convert a string to an integer value..?
If thats so, you can use:
int val = Integer.parseInt(stringValue);
You should remember that these sort of conversion methods throw exceptions when they fail - e.g. it's not a number value, therefore you should place try, catch to contain the problem.
Hope this is OK
HD
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|