forum > How can I know the Haxe version?
-
xr.zeng Aug 19 at 03:35
code like below:
#if haxe_208
trace("haxe 2.08");
#else
trace("not haxe 2.08");
#endHow can I check if the version is greater than 2.08?
like this:
#if version >= haxe_208
trace("greater than or equal haxe 2.08");
#else
trace("less than haxe 2.08");
#end;Thanks!
-
John Plsek Aug 19 at 04:55
Let me start by saying, I could be wrong
According to the manual - http://haxe.org/ref/conditionals
#if haxe_210 trace(" haxe version == 2.10"); #else trace(" haxe version != 2.10"); #end
so
#if haxe_208 trace(" haxe version == 2.08"); #else trace(" haxe version != 2.08"); #end
BUT - from something I read somewhere, and actually trying it, it's really
#if haxe_208 trace(" haxe version >= 2.08"); #else trace(" haxe version < 2.08"); #end
-
xr.zeng Aug 19 at 16:37
Actually, it is in away3dlite.core.utils
Cast.hx
#if haxe_206
import flash.errors.Error;
#else
import flash.Error;
#endand my haxe version is 2.08. Then it can't be compiled.
../away3d/trunk/haxe/Away3DLite/src/away3dlite/core/utils/Cast.hx:14: characters 0-19 : Class not found : flash.Error
-
John Plsek Aug 20 at 01:30
The behaviour I described with
#if haxe_208seems to have changed since 2.09
From a quick look at haxe source code, in 2.08 and earlier
#if haxe_xyywould only be true when the version is exactly x.yy
Just upgrade to current haxe - then you'll have no such compatibility issues