Synopsis: Programming With Modules and IndependentModules
jjweimer
NameSpace: ProcGlobal | |||
---|---|---|---|
pros: all external calls possible, can use #include at the top of the procedure file cons: possible conflicts with overlapping FNAME names, procedure file recompiles each time | |||
Module Type | Function Type | Scope | call FNAME via |
General (no module) | * Non-Static * Static | public local | FNAME NONE |
Module | * Non-Static Static | public semi-public | FNAME MNAME#FNAME |
NameSpace: IndependentModule | |||
pros: limited (if any) conflicts with FNAME names, "crash-safe" (compiled only once when opened) cons: external calls possible only via Execute, use of #include to been done with caveats | |||
Module Type | Function Type | Scope | call FNAME via |
General (no module) | Non-Static Static | semi-public local | IMNAME#FNAME NONE |
Module | Non-Static Static | semi-public semi-public | IMNAME#MNAME#FNAME IMNAME#MNAME#FNAME |
In summary:
- If you write procedure files primarily for your own use, you likely need never use #pragma ModuleName or #pragma IndependentModule designations, otherwise
- If you want to avoid name conflicts among functions in various procedure files (distributed or otherwise), either a) use #pragma ModuleName designations and static functions or b) use very well randomized function names, and
- If you want to assure that your procedure file is reliably (if not perfectly) self-contained, use #pragma IndependentModule designations
Comments and updates are welcomed.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
August 6, 2010 at 04:51 pm - Permalink
Fixed. Thank you!
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
August 8, 2010 at 06:55 pm - Permalink
http://www.igorexchange.com/node/7674
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
April 26, 2017 at 08:21 am - Permalink