Convert Int To String?

Miscellaneous Forums/Win32 Discussion/Convert Int To String?

Hi!

Any Ideas how to successfully convert INT to Str?

Old:
MyString$=Str(MyInt)

New?
MyString$=String(MyInt) 'Not working

Thanks!

Missed a ":String" in the Function declaration that caused the error.

Better docs would help... :/

YES. Better docs would help!

Don't INTs get type converted automatically when you do, say:
MyString$ = 300
?
EDIT: Yep, just tested it. Works fine without manual type conversion.

Russell

p.s. Yes, I think the Win32 beta is solid enough that it could be released as a release version, which would allow Mark\BRL to concentrate on the Docs, whose importance can not be overstated...

I also found that you cannot just put a String to a Int, if you know that the content of the String is a number.

local MyInt:Int
local MyString:String

...

MyInt = MyString


This worked in previous Blitzes, in BMax not anymore.
Now I have to do:
MyInt = MyString.ToInt


The reverse is also possible:
MyString = MyInt.ToString


You can also cast it.

myInt = Int(MyString)

See the Wiki

http://www.blitzwiki.org/index.php/Type_Casting

Aaron