<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">The error message is misleading. It's probably the<div>same global variable that is declared more than once.</div><div>It's detecting that it's trying to write a file by the same</div><div>name twice and complaining about that. Remember</div><div>that every global (top level variable) gets its own file.</div><div><br class="webkit-block-placeholder"></div><div>If we have need to allow something like this:</div><div><br class="webkit-block-placeholder"></div><div> var x;</div><div> ...</div><div> var x;</div><div><br class="webkit-block-placeholder"></div><div>(like they allow in C), I'll need to make some changes.</div><div><br class="webkit-block-placeholder"></div><div>Let me know, In the meantime, I'll fix the error message.</div><div><br></div><div><br class="webkit-block-placeholder"></div><div><div><div><div>On Mar 27, 2008, at 5:42 PM, Henry Minsky wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">The compiler complains about compiling tests in test/lztest<br><br>(I removed the debug=true from the lztest-animator.lzx, and it says<br><br>Compiling: ../lztest/lztest-animator.lzx to ../lztest/lztest-animator.lzr=swf9.swf<br> Compilation errors occurred:<br>: org.openlaszlo.sc.CompilerError: cannot declare class name more than once: "LzTestManager"<br><br>lps/components/lztest/lztestmanager.lzx defines the LzTestManager, it's not a class, just an object<br> with methods on it (prototype-style OO). <br><br>I haven't looked yet what it is compiling to, is there a way to get the script compiler to give more info? <br><br><br><div class="gmail_quote">On Thu, Mar 27, 2008 at 5:30 PM, P T Withington <<a href="mailto:ptw@pobox.com">ptw@pobox.com</a>> wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">We're getting real close! Can we run an lzunit test now?<br> <div><div></div><div class="Wj3C7c"><br> On 2008-03-27, at 16:43 EDT, Henry Minsky wrote:<br> > Hey, I got the test to run, by manually fixing up the superclass<br> > name, the<br> > entry in ConstructorMap, and that boolean type declaration.<br> ><br> > Yay!<br> ><br> ><br> > On Thu, Mar 27, 2008 at 4:28 PM, Henry Minsky <<a href="mailto:henry.minsky@gmail.com">henry.minsky@gmail.com</a>><br> > wrote:<br> ><br> >> Tucker and I are working on the class name issue, we are putting<br> >> something<br> >> into the compiler to<br> >> put the correct LFC classnames (LzView, LzNode, etc) as the<br> >> superclass<br> >> name.<br> >><br> >> And we're adding code to enter the user-class name into the<br> >> ConstructorMap<br> >> table, so that the instantiator<br> >> knows what real JS class name corresponds to the LZX tag name.<br> >><br> >> Thanks!<br> >><br> >> Maybe we should have a chat room going so we can all see what's<br> >> happening. Are you on iChat Don?<br> >><br> >><br> >><br> >> On Thu, Mar 27, 2008 at 4:06 PM, Donald Anderson <<a href="mailto:dda@ddanderson.com">dda@ddanderson.com</a>><br> >> wrote:<br> >><br> >>> I'm looking at the generated code now.There's a few things that<br> >>> pop out<br> >>> right away.<br> >>><br> >>> 1) we generate this:<br> >>><br> >>> dynamic class $lzc$class_foobar extends $lzc$class_view {<br> >>><br> >>> I'm guessing that this should be extends 'LzView' ?<br> >>> That's what you need the LFC dictionary for?<br> >>> So I changed the three occurrences of $lzc$class_view to LzView.<br> >>><br> >>> 2) it looks like there are some static stuff in the user class like<br> >>> this:<br> >>><br> >>> static var tagname = "foobar";static var children =<br> >>> LzNode.mergeChildren([{attrs:<br> >>> {bgcolor: 16711000, height: 100, width: 100}, name: "view"}, {attrs:<br> >>> {bgcolor: 255, height: 150, width: 200, x: 175, y: 100}, name:<br> >>> "view"}],<br> >>> $lzc$class_view["children"]);static var attributes = new<br> >>> LzInheritedHash($lzc$class_view.attributes);<br> >>><br> >>> Is there some what that the name "foobar" gets registered to the<br> >>> application to know about this class?<br> >>> Is it some side effect of this static code? (if so, we need a way<br> >>> to get<br> >>> the class initialized).<br> >>> But I don't see the string "foobar" anywhere, except in the tagname.<br> >>><br> >>> After all, the main code has this:<br> >>> LzInstantiateView({attrs: {x: 100}, name: "foobar"}, 3);<br> >>><br> >>> So it's got to find the name "foobar" someplace?<br> >>><br> >>> 3) there are compilation errors in $lzc$class_foobar.as, and we<br> >>> don't<br> >>> see them because<br> >>> $lzc$class_foobar is never referenced anywhere. My temporary<br> >>> workaround<br> >>> was to insert<br> >>> a dummy function in $lzc$class_foobar:<br> >>><br> >>> static function $init$() { }<br> >>><br> >>> And insert code into the LzApplication's constuctor():<br> >>><br> >>> $lzc$class_foobar.$init$();<br> >>><br> >>> (This is all done manually for debugging).<br> >>><br> >>> Now when I compile I start getting errors:<br> >>><br> >>> /Users/clients/laszlo/lib/jakarta-tomcat-5.0.30/temp/lzswf9/<br> >>> lzgen23563/$lzc$class_foobar.as(6):<br> >>> col: 89 Error: Type was not found or was not a compile-time<br> >>> constant:<br> >>> boolean.<br> >>><br> >>> function $lzc$class_foobar (parent:LzNode, attrs:Object,<br> >>> children:Object? = null, async:boolean = null)<br> >>><br> >>> So boolean = null should be Boolean = false (is this something<br> >>> generated by tag compiler?)<br> >>><br> >>> 4) fixing that gets a clean compile, but same behavior (blank<br> >>> canvas).<br> >>> I suspect it's something to do with 2) above - somehow we need<br> >>> to register the 'foobar' class so it can be instantiated at<br> >>> runtime as<br> >>> needed.<br> >>><br> >>> Henry - I think these issues need your expertise, but if there's<br> >>> something<br> >>> I can assist with, shout. BTW, my cell is 617-306-2057, feel free<br> >>> to<br> >>> call.<br> >>> I'll be reading email too.<br> >>><br> >>> - Don<br> >>><br> >>><br> >>><br> >>> On Mar 27, 2008, at 1:20 PM, Henry Minsky wrote:<br> >>><br> >>> with this test case<br> >>><br> >>> <canvas width="1000" height="600" bgcolor="#eeeeff"><br> >>> <class name="foobar" ><br> >>> <view width="50" height="50" bgcolor='red'/><br> >>> <view y="50" x="75" width="100" height="50" bgcolor='blue'/><br> >>> </class><br> >>><br> >>> <foobar x="100"/><br> >>> <foobar x="200" y="200"/><br> >>> <foobar x="300" y="400"/><br> >>><br> >>><br> >>> </canvas><br> >>><br> >>> I get this compiler error in swf9<br> >>><br> >>> lzc --runtime=swf9 hello-classes.lzx<br> >>> Compiling: hello-classes.lzx to hello-classes.lzr=swf9.swf<br> >>> Compilation errors occurred:<br> >>> : org.openlaszlo.sc.CompilerError: $lzc$class_foobar: class or mixin<br> >>> name may conflict with internally generated names<br> >>> badtzmaru:swf9 hqm$<br> >>><br> >>><br> >>> --<br> >>> Henry Minsky<br> >>> Software Architect<br> >>> <a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br> >>><br> >>><br> >>><br> >>> --<br> >>><br> >>> Don Anderson<br> >>> Java/C/C++, Berkeley DB, systems consultant<br> >>><br> >>> voice: 617-547-7881<br> >>> email: <a href="mailto:dda@ddanderson.com">dda@ddanderson.com</a><br> >>> www: <a href="http://www.ddanderson.com" target="_blank">http://www.ddanderson.com</a><br> >>><br> >>><br> >>><br> >>><br> >>><br> >><br> >><br> >> --<br> >> Henry Minsky<br> >> Software Architect<br> >> <a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br> >><br> >><br> ><br> ><br> > --<br> > Henry Minsky<br> > Software Architect<br> > <a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br> <br> </div></div></blockquote></div><br><br clear="all"><br>-- <br>Henry Minsky<br>Software Architect<br><a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br><br></blockquote></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br class="Apple-interchange-newline">--</div><div><br class="webkit-block-placeholder"></div><div>Don Anderson</div><div>Java/C/C++, Berkeley DB, systems consultant</div><div><br class="webkit-block-placeholder"></div><div>voice: 617-547-7881</div><div>email: <a href="mailto:dda@ddanderson.com">dda@ddanderson.com</a></div><div>www: <a href="http://www.ddanderson.com">http://www.ddanderson.com</a></div><div><br class="webkit-block-placeholder"></div></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline"> </div><br></div></div></body></html>