reference to externally declared var fails
I’m probably pushing the language a bit here as I suspect that only externally declared
functions are allowed at present. However, the parser does allow the following hybrid syntax
through ‘external var foo: String;’. This generates code very close to that which is needed.given:
module extTest import mobl external sync function fTitle() : String // semicolon not required external var title : String; // semicolon required!! (but this is not the main issue) <javascript> extTest.fTitle = function() { return "To Do Manager"; }; extTest.title = "foo"; </javascript>`
and elsewhere…
import extTest screen root() { header(fTitle()) /* works: generates mobl.ref(extTest.fTitle()) */ }
but
Submitted by Mike Pearson on 10 May 2011 at 19:18import extTest screen root() { header(title) /* fails: generates mobl.ref(title) rather than mobl.ref(extTest.title). The latter works */ }