What the..

BlitzMax Forums/BlitzMax Programming/What the..

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

It's how things are being optimized by the compiler. On the last Print statement, the compiler sees that you are converting a literal string to an int, back to a string, then printing. So it optimizes by removing all of the conversion code and printing 23 directly (which is what the value of --23 actually is.). Since you store "--23" in a string variable for the other prints, the compiler can't optimize it and so the conversion is done during run time, and it can't come to grips with the double "--", so the conversion returns 0. You can see this by looking at the .s file the compiler generates.
Now I wonder why the compiler is able to convert "--23" properly, but the runtime modules can't.