Android Question NEWBIE ALERT! VALUE OF A TEXTBOX

Ryan Pigeon

Member
I AM LOOKING FOR VB6 FRIENDS! HOW DOES ONE GET THE VALUE OF A TEXTBOX!? IN OTHER WORDS :

NOT : price=txtPrice.Text

BUT: price = val(txtPrice.Text)
 
Solution
price=txtPrice.Text
It will be converted automatically.
You can check if the text is a number before the conversion.
B4X:
If IsNumber(txtPrice.Text) Then
    price = txtPrice.Text
Else
    price = 0
End If

DonManfred

Expert
Licensed User
Longtime User
Please do not Scream! All uppercased is considered screaming.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
price=txtPrice.Text
It will be converted automatically.
You can check if the text is a number before the conversion.
B4X:
If IsNumber(txtPrice.Text) Then
    price = txtPrice.Text
Else
    price = 0
End If
 
Upvote 1
Solution

Ryan Pigeon

Member
price=txtPrice.Text
It will be converted automatically.
You can check if the text is a number before the conversion.
B4X:
If IsNumber(txtPrice.Text) Then
    price = txtPrice.Text
Else
    price = 0
End If

Thank you my man! I actually found a short document on VB6 to B4A commands.
 
Upvote 0

MikeSW17

Active Member
Licensed User
Longtime User
Clue, Automatic type conversion.
B4X:
Dim StringVariable  as String
Dim NumberVariable    as Double

StringVariable = "123.45"
NumberVariable = "123.45"
 
Upvote 0

Sandman

Expert
Licensed User
Longtime User
How do I move it off? Or do I simply start in the other thread?
Only the admin can move a thread.

So instead you should pick a post in this thread that contain the solution to your initial question, and then just leave the thread so others can benefit from it later on.

Then start a new one on Chit Chat.
 
Upvote 0

Ryan Pigeon

Member
Only the admin can move a thread.

So instead you should pick a post in this thread that contain the solution to your initial question, and then just leave the thread so others can benefit from it later on.

Then start a new one on Chit Chat.
Thank you for the info! Will abide.
 
Upvote 0
Top