- use io.include() to move those hashes at the top of the file to a separate Nasal file
- instead of using l0..l20/r0..r20 etc - use vectors (arrays) instead: http://wiki.flightgear.org/Howto:Start_ ... s_in_Nasal and: http://wiki.flightgear.org/Howto:Use_ve ... orter_code
- mode & page handling could be greatly simpflied and generalized by using helper classes, analogous to the gpsmap196 or avidyne code:
To see how io.include() is used, check out: https://gitorious.org/fg/canvas-hackers ... /GPSmap196
Specifically see the top of the file: https://gitorious.org/fg/canvas-hackers ... map196.nas
As you can see, we're including/using a separate mfd.nas file that contains helpers for "modes" & "pages", and yet another file that implements each page.
The point is not that this is the way this MUST be done, but just to demonstrate how a more flexible approach can be implemented.
In fact, the Avidyne code is much better here - but not as easily reusable.
Given the size of the efb.nas file and the compactness of the gpsmap196 in comparison, you may find that it's fairly straightforward to borrow ideas from it. Let me know if you have any questions or need specific examples/code snippets.
Obviously, understanding how classes and objects work in Nasal would be really useful, but we have fairly good Nasal/OO tutorials, if you disagree, just let us know what's missing, and I can edit the wiki accordingly.
Given your background, my suggested order of reading would be this:
http://wiki.flightgear.org/Howto:Unders ... nd_Methods
http://wiki.flightgear.org/Howto:Start_ ... mmended.29
http://wiki.flightgear.org/Object_orien ... g_in_Nasal
http://wiki.flightgear.org/Object_Orien ... with_Nasal