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

import extTest
screen root() {
    header(title)  /* fails: generates mobl.ref(title) rather than mobl.ref(extTest.title). The latter works */
}
Submitted by Mike Pearson on 10 May 2011 at 19:18

On 11 May 2011 at 15:25 Zef Hemel commented:

Good catch! Will be fixed in 0.4.4.


On 11 May 2011 at 15:25 Zef Hemel closed this issue.

On 11 May 2011 at 15:25 Zef Hemel tagged 0.4.4

Log in to post comments