[haXe] Strange exception with resulting "string" from systools.Registry.getValue

Asger Ottar Alstrup asger at area9.dk
Tue Sep 19 20:27:40 CEST 2006


Hi,

Try this program with swhx and systools:

--
import systools.Registry;

class Test {
    static function main() {
        var value= Registry.getValue(Registry.HKEY_CLASSES_ROOT,
".hxml\\shell\\Compile\\command", "");
        trace( ".hxml is handled by '"+value+"'");
        // Try this without the "" + and you get an exception!
        var result : String = "" + value;
        trace(result.length);
    }
}
--

This works, and prints

Test.hx:6: .hxml is handled by '"C:\flash\haxe-1.07\haxe.exe" -prompt "%1"'
Test.hx:8: 42

as expected.

Now, remove the seemingly redundant "" + on the result line, and the result
is an exception:

Called from Text.hx line 8
Invalid field access: length

Wierd! It seems like the result of getValue is not really a string after
all.

Regards,
Asger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.motion-twin.com/pipermail/haxe/attachments/20060919/e8b9ec1d/attachment.htm


More information about the Haxe mailing list