IDE Script Str(True) errors?!

I was just trying to find a bug in some IDE Script code and I’ve just found out that Str(True) errors!!

Is that a bug, by design or am I just doing something stupid?

Try it, add the following to a new IDE Script and run it:

Print(str(True))

This works in regular Xojo, so why the issue in script?

System.DebugLog(Str(True))

Do I need some sleep or am I going mad?

I guess I’ll have to use this for now:

Print(If(True,"True","False"))

I just found this after getting to the end of the post feedback://showreport?report_id=30626 from 2013

Mehhhh :S

Isn’t it Str(Val(True))?

Nope, val needs a string

why would this not work (I don’t do console)

dim b as boolean=false
print(b)
print(true)
print(false)

since you aren’t doing any processing, it shouldn’t matter (unless of course you were just using “PRINT” to illusatrate the issue)

Print needs a string also so Print(true) doesn’t work, but yes I’m just using Print for an example as trying to Print the result of an str should work :slight_smile: I’m mainly trying to illustrate the issue with str though.

Does this work:

print cstr(True)

Nope

Remember - Julian’s running into this in IDE Script, not normal Xojo. I would see this as a bug since it “SHOULD” work as we normally use it in Xojo. I would add more comments to that FB report.