MiniM Knowledge Base | Sep 24, 2010
Routine export file formats
Here are described file formats of routine export which are used in the MiniM Database Server.
For an export and import MiniM Database Server use standardized file formats
and standard conventions how to create file content. Standard allow portable
verdor-specific differences. Main file format specification is defined by
Routine export file is a text file. All string from line begin up to line
feed symbol or up to file end (if line feed symbol is not reached) threated as
one line, one atomic portion of export. The symbol of line feed is
First two lines of a file are file header. This lines does not fixed by standard and are used for special information such as export comment, export date and time and other. MiniM Database Server use only two conventions for this first two lines:
Also custom written exporting program can use this first two lines by own opinion.
Next, after header's two lines follows routine export blocks and after last one must be written one more empty line as export end indicator.
Routine export block consist of:
So, routine export file must contain at the end two empty lines - end of last routine export and end of all export.
In practice, any line of the routine can be empty line if vendor support such routines. And at export this line must be replaced to line with one space symbol.
Example. Let it be a routine with the following content:
RouName ; comment here q label(param) w param q
So at export in the ANSI format we got the file:
2:30 0 12-jun-2010~Format=ANSI.S~ | line with date and time of export | empty comment line RouName | routine name RouName ; comment here | 1 line q | 2 line label(param) | 3 line w param | 4 line q | 5 line | empty line, end of routine | empty line, end of export [EOF]
If file must contain several routines, after each empty line as a routine terminator must follows next routine name, routine body and so one.
Autoimport format is a special calling convention about export header to import routines in the file automatically, without other import software. If on the export was specified autoimport option, first two lines contains special MUMPS command sequence so this file can be passed to MiniM executable:
minim.exe < rouname.rou
In this case MiniM process reads and executes file content line-by line and first line starts import. Other content of file will be read from current input device |STD|. Autoimport commands can use first line or both two first lines. MiniM Database Server use convention allowed to import file with autoimport option as such as ordinal routine export file.
For example, MiniM Routine Editor on the export creates file with the following autoimport header:
n h,r,l r h f r r q:r="" s h=$p(r,"^",4) >>> s h=$s(h:h,1:$h) s r=$p(r,"^") >>> f r l i l="" q:l="" >>> s ^ROUTINE(r,$i(^ROUTINE(r)))=l >>> s ^ROUTINE(r,0)=h 2:38 0 12-jun-2010 MiniM Routine Editor export RouName RouName ; comment here q label(param) w param q [EOF]
Here symbols >>> means continuous of line.
Common export conventions of routine export includes convention allowed to import routines from file independently of the header content. This means that the export software cannot use more than two first lines for special information but can use file after last two empty lines.
For routine export files operator can use any file extension, the most widely used extensions are: