|
|
Experimental Physics and
| ||||||||||||||||
|
|
msi is more generic than dbLoadTemplates and thus doesn't report the same errors that dbLoadTemplate reported. I will also suggest is that what is required is something that checks that dbLoadDatabase will work on the file created by msi. base has a test routine that could be used. It is located at <base>/src/dbStatic/dbReadTest.c. It calls dbLoadDatabase for selected files and reports errors if dbLoadDatabase fails and reports nothing if dbLoadDatabase succeeds. Examples: This should work with any version of base cd <base>/bin/<arch> Then create two files test.db
record(ai,"test")
{
}test1.db
record(ai,"test")
{
field(SCAN,"1 second")
}
record(ai,"test1")
{
field(JUNK,"xxxx")
}Then the following happens mercury% dbReadTest usage: dbReadTest -Idir -Smacsub file.dbd file.db mercury% This is just to show what dbReadTest accepts as input. mercury% dbReadTest -I ../../dbd ../../dbd/base.dbd ./test.db mercury% Since test.db was a valid file dbReadTest reported nothing. mercury% dbReadTest -I ../../dbd ../../dbd/base.dbd ./test1.db Error filename="../dbLexRoutines.c" line number=899 Field Not Found Last token ")" input line: field(JUNK,"xxxx") in: file ./test1.db line 7 db_parse returned -1 For input file ./test1.dbfilename="../dbReadTest.c" line number=77 from dbReadDatabase mercury% Thus it reported an error. I suspect you will want to start with dbReadTest and produce something more compatible with your requirement. Marty
| ||||||||||||||||
| ANJ, 10 Aug 2010 |
·
Home
·
News
·
About
·
Talk
·
Base
·
Modules
·
Extensions
·
· Distributions · Download · Documents · Links · Licensing · |