Hi,
I have a string value stored in a KeyValueStore object. That value could be empty or have a long number type value. If this value is not a number greater than 0 (it could be 0, it could be empty, it could be nonsense since is a value I don't set) I want to perform something. If it is a number greater than 0, then it's OK and I don't have to do anything.
Remito has to be a string because is where I store a value coming from a webservice, which could be a string.
That code throws me an error: java.lang.NumberFormatException: Invalid double: ""
Also, if I declare an int or a long type variable to store the "starter.conf..." I get the same error.
"If Remito = 0" doesn't work either if Remito is an empty string value.
Which would be the correct way to make this?
Thank you!
I have a string value stored in a KeyValueStore object. That value could be empty or have a long number type value. If this value is not a number greater than 0 (it could be 0, it could be empty, it could be nonsense since is a value I don't set) I want to perform something. If it is a number greater than 0, then it's OK and I don't have to do anything.
Remito has to be a string because is where I store a value coming from a webservice, which could be a string.
B4X:
Remito = Starter.Conf.GetDefault("remito", 0)
If Not(Remito > 0) Then
.
.
.
End If
That code throws me an error: java.lang.NumberFormatException: Invalid double: ""
Also, if I declare an int or a long type variable to store the "starter.conf..." I get the same error.
"If Remito = 0" doesn't work either if Remito is an empty string value.
Which would be the correct way to make this?
Thank you!