string + string doesnt work??
BlitzMax Forums/BlitzMax Programming/string + string doesnt work??
| ||
Hmm i could of swore i've done this before but it's telling me '+' can only be used in numeric types. WriteLine Design,"<p><b><font size=" + Chr(34) + "6" + Chr(34) + ">" + ProjctNametxt + "</font></b></p>" |
| ||
tmp = WriteFile("hey.txt") WriteLine tmp, "<p><b><font size=" + Chr(34) + "6" + Chr(34) + ">" + "myproject" + "</font></b></p>" CloseFile tmpworks for me with 1.22. |
| ||
It seems you're not using superstrict, and the variable ProjctNametxt (as it is not well written) is created as a Integer. That could explain why BlitzMax tells it is not possible to sum a number and a string. (just a possibility) :D |
| ||
@ziggy: nopeLocal MyInt:Int Local MyString:String MyInt = 42 MyString = "The Answer to Life, the Universe, and Everything is " + MyInt Print MyString BlitzMAX just converts the Int to a String and appends. Works even in SuperStrict mode. But I do bet that ProjctNameTxt is the problem. @ckob: What is the error exactly that you are getting? |
| ||
Ckob, There's something else going on in your code. That line works perfectly with no alteration when I compile it with BlitzMax 1.22. I've also tried all kinds of silly things to trip it up, but nothing works. ProjctNametxt isn't a function or a method, is it? SpaceAce |
| ||
The "numeric type" error often appears if you use objects and do not do .toString() to make sure they are a addable type ... |