string compare in android wont compile
Monkey Forums/Monkey Bug Reports/string compare in android wont compile
| ||
Import mojo Class humors Extends App Field stringy:String Method OnUpdate:Int() If "trev "+stringy="trev vv" Print "it matches" Endif End Method Method OnRender:Int() Cls(100,100,100) End Method Method OnCreate:Int() SetUpdateRate 30 End Method End Class Function Main:Int() New humors End Function if you try to compile this in android it will complain about the string comparison |
| ||
I hate to ask, but just in case: Did you try [monkeycode] If ("trev "+stringy)="trev vv" [/monkeycode] I've had weird things happen when I didn't specify groups like that. For instance, for you, it might be trying to parse the boolean value of [monkeycode]stringy="trev vv"[/monkeycode] first, then adding a boolean to a string. |
| ||
it works on the other platforms so it has to be just an android issue. |
| ||
It is a target consistency bug with the way Java is being generated. However, if you want to progress rather than wait for the fix, you can avoid it by creating a local string variable with the concatenation and using that variable in the comparison. |
| ||
yeah i just used stringy.Compare(other_string) |