Experimental Physics and
| |||||||||||||||||
|
Gasper Pajor wrote:
Actually I prefer to get reports by email first, so I can do some triage before they go into Mantis. However, either way works. Anyway, when starting an IOC (epics 3.14.x on linux) with a template file that has unexpanded macros in comments (i.e. in lines beginning with '#'), the errors are printed to IOC console: Unfortunately this is not currently possible because of the order in which we parse the .db files - macro expansion takes place before the text gets fed to the tokenizer and parser, so when we're looking up the macro values we don't know whether we're currently parsing a comment line or not. There are advantages and disadvantages in this, and unfortunately I don't know whether anybody is making use of the addtional capabilities this provides. For example, this record definition and dbLoadRecords line are legal as far as the IOC's parser are concerned: record($(type),"$(name)"){ field($(field)) } dbLoadRecords("db/example.db","type=ai,name=input,field='DTYP, xy240'") I suspect that no tool like VDCT would accept the .db file, but if my understanding is correct the IOC would be perfectly happy with it. It would even be possible to start a comment inside a macro value, although that would be a rather strange thing to do. I'm not saying I particularly like the way this has been implemented, but that's what the code we currently have does, and before I can change it I would have to poll the community to see whether anybody is relying on it. Any comments from unconventional users of macros like the above record definition would be appreciated, in case we decide to change things in the future. There is a way to prevent the error message associated with an undefined macro, which is to give the macro a default value. The following comment line should not generate any errors from dbLoadRecords: # $(macro=) The equals sign is used to introduce a value to be used in the event that the macro doesn't exist at the time it's expanded, and this may be sufficient for your purposes. This syntax has been supported by macLib since Base R3.14.6. - Andrew -- The right to be heard does not automatically include the right to be taken seriously. -- Hubert H. Humphrey
| ||||||||||||||||
ANJ, 10 Nov 2011 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |