> Can anybody explain to me why I am getting a 'no default value error' all the > time it's killing me? > function (__structure Out) main (__structure Input) > { > var result = new Object(); > if (!_testMode && Input) { > CR = String.fromCharCode(13); > Log(CR+CR+CR+"#### Test this error that says \"TypeError: No > default value\" ####"+CR) > for (i in Input) > { > _in = Input[i]; > /* > This line works: > */ > Log (i+": _in: "); > /* > These line doesn't! > Log (i+": _in: "+_in); <—— Here > Log (i+": _in: "+Input[i]); <—— And here ! > > */ > } > result.Out = true; > } > return result <--- missing a semicolon! ;) > } > > Composition is attached for testing.
Don't use CR like that -- "\n" will do you just fine (as in "\n\n\nA line with 3 empty lines above it!\n\n\n"). _in and Input[i] (which are the same thing) are JS objects. More specifically, they're structures (you're passing in a structure of structures). Log(i+": _in:"+typeof(_in)); will tell you it's an "object" (which can't generally be logged). Log(i+": _in:"+_in[0]); will print the first value of each substructure (which happens to be a number, which is OK for logging). > On a side not I just found that my often cited problems with the JS patch not > parsing perfectly good code (as delete everything except for four lines of > code) can be got around sometimes by doing the save, close comp, open comp > shuffle. Doesn't always work though :/ Perhaps this got fixed on 10.6 so I > sound like an idiot talking to himself? I've not seen this even on my 10.5 machine (and I've cut pages and pages and pages of JS code on that machine in QC). You're omitting a semicolon on the return statement (so while the code is valid JS, it's not as nice as it could be). You're also assigning a boolean (true) to a value (Out), but telling QC that it should expect a Structure (__structure). This won't bother JS, but it might confuse QC. Still waiting for reliable steps to recreate this parse problem you allude to -- perhaps it's PPC specific? -- Christopher Wright christopher_wri...@apple.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartzcomposer-dev mailing list (Quartzcomposer-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com