Discuz! Board

 

 

Search
Discuz! Board Forum Integration Questions compile ERROR: false is not supported
View: 948|Reply: 2
go

compile ERROR: false is not supported

Rank: 2

Post on 2011-10-15 16:25 |All posts
Last edited by dcsan on 2011-10-15 16:26

I got this today, yet true and false are used in the docs... or is this actually the case that we have to use 1 and 0 everywhere?

also when i got this:Generating file : projects/trav1/pikkle/Button.as
ERROR: false is not supported
ERROR: false is not supported
ERROR: true is not supported


there are no line numbers. so it seems like some other compiler weirdness...

but if true/false are really not supported, is there any documentation on how these 0/1/null evaluate?


Rank: 2

Post on 2011-10-15 16:50 |All posts
here's an example:
  1. class Tester{

  2.   function Tester() {
  3.   }

  4.   function init() {
  5.     var a;
  6.     var b:boolean;  // i guess the types are ignored
  7.     var c:gibberishtype;  // no error!
  8.     a = true;  // ERROR: true is not supported
  9.     b = false; // ERROR: false is not supported

  10.     c = 2;
  11.     a = "int:" + c;    // E/papaya  : Object can't add (int:)
  12.     a = "str:" + c.toString();  // Object can't be added (None) PC:633
  13.     a = "str:" + str(c);
  14.     return a;
  15.   }

  16. }
Copy

Rank: 4

Post on 2011-10-17 14:22 |All posts
You got the right result. "true" is 1, "false" is 0, so in the compiler they were just omitted. You may use 1 and 0.  

null is different from 0.

There is no type system, so
    var b:boolean;  // i guess the types are ignored
    var c:gibberishtype;  // no error!
can be compiled, but types are ignored.

a = "int:" + c;  Cannot add String with Int, you may do "int:"+str(c);
There is no toString() API
Security Q&A Change Security code Change

Archiver|Comsenz Inc.

All time is GMT+8, 2013-5-21 04:55 , Processed in 0.029834 second(s), 10 queries .

Powered by Discuz! X1.5

© 2001-2010 Comsenz Inc.