AW: [mtasc] Recursive function problem
Sönke Rohde
rohde at rivavx.com
Thu Apr 7 14:58:12 CEST 2005
> -----Ursprüngliche Nachricht-----
> Von: mtasc-bounces at lists.motion-twin.com
> [mailto:mtasc-bounces at lists.motion-twin.com] Im Auftrag von
> Nicolas Cannasse
> Gesendet: Donnerstag, 7. April 2005 14:43
> An: MotionTwin ActionScript2 Compiler List
> Betreff: Re: [mtasc] Recursive function problem
>
> > Mtasc-error:
> > .../XMLUtils.as:33: lines 33-35 : type error Boolean should
> be XMLNode
> >
> >
> > Is this possible with matsc?
>
> No.
> The statement a || b || c is typed as "Boolean" in MTASC.
> So the compiler complains about your last return being a
> Boolean while two
> others are XmlNode.
>
> Nicolas
But the line: return XMLUtils.byName(node.firstChild,nodeName)
|| XMLUtils.byName(node.nextSibling,nodeName)
|| null;
is XMLNode || XMLNode || null
Which is all typed XMLNode.
Anyway, is there another way how I can implement this function compatible to
mtasc?
Thanks,
Sönke
More information about the mtasc
mailing list