DLL Usage description

Library: dadllcommon

This library contains common functionality that does not belong to any other, more specific library.

Unless specified otherwise the following formats should be used for passing parameters/can be expected as return value:

table     : ppmmmnnn tablefield: ppmmmnnn.ccccccccc domain    :

DLL Prototypes

function extern string text.line())
 pre  : true post : in text.line all ASCII characters 255 are replaced with new
 function extern string text.line())
 pre   : true post  : in text.line all new line characters are replaced with
       character 255.
 function extern display.mess(const string msg())
 pre   : true post  : msg is displayed in the user_message part of the 'progress
        window'. The user_messagepart of the window can contain 72
        characters at most. desc  : see dllusage of function
 function extern display.xch.progress(
                domain daxch.txch xch.type,
                const domain daxch.cxch xch.scheme,
                const domain daxch.cbat batch,
                domain daxch.batl batchline,
                const domain daxch.ttbl triton.table,
                const domain daxch.casf ASCII.file,
                long run.num,
                long try.num,
                const string filename(),
                long no.processed,
                long no.error.rejected,
                long no.cond.rejected,
                long no.skipped)
 pre   : true post  : Information passed as parameters is displayed in a window
desc  : Window should look like:

| Exchange Scheme: FFFF  Records read                           |
| Batch          : FFFF  Records processed             : FFFF   |
|                                                               |
| Batchline      : FF    Records rejected due to errors: FFFF   |
|                                                               |
| Table   : FFFF  Records rejected due to conds.       : FFFF   |
|                                                               |
| ASCII File     : FFFF  Records skipped without action: FFFF   |
|                                                               |
| Run-/trynumber : FF/FF                                        |
|                                                               |
|                                                               |
|           FFFFFFFFFFFFFFuser_messageFFFFFFFFFFFFFF            |

 function extern long domain.exists(const string
 pre   : true return: whether <> is an existing domain
 function extern long field.exists(
                const domain daxch.ttbl,
                const domain daxch.tfld,
                [ ref string ],
                [ ref long field.type ],
                [ ref long field.flag ],
                [ ref long field.depth ])
 pre   : format of is without table return: whether <> is
an existing field of table <>
        (if it is a combined field false will be returned) post  : if true is
returned and one or more of the optional parameters
        are specified they will be given their proper value
 function extern long generate.unique.key()
 pre   : true return: a unique value is returned by this function which will
never be
        returned again.
 function extern string
                const string tble(),
                long )
 pre   : > 0 return: the name of the <>th field in index
<> of table
        <tble>. IF either <tble> does not exist or <tble> does not have
        an index <> or index <> does not have at least
        <> fields THEN the empty string is returned.
        Note that the data dictionary is read using the rdi functions,
        thus according to the current package combination of the user.
 function extern string get.separator(
                const domain daxch.cxch xch.scheme )
 pre   : true return: xch.scheme exists ==>
        (daxch001.ctrl,daxch001.sepa) otherwise ==> "" state : current record of
daxch001 will not be changed
 function extern long index.exists(
                const domain daxch.ttbl,
                [ ref long ],
                [ ref long duplicate ] )
 pre   : true return: whether <> has an index with number <>.
post  : if true is returned the contains (if provided) the
        number of fields belonging to the index and duplicate,
        if provided, tells whether duplicates are allowed.
 function extern long is.index.field(
                const string tble(),
                string fixed )
 pre   : > 0 return: whether field <> belongs to index
<> of
        table <tble>
 function extern long is.numeric.constant(const string str())
 return: true if and only if str contains a long or float constant
        (possibly in scientific notation)
 function extern long is.text.buffer.field(const string
 pre   : true return: whether <> is "tttxt010.text" or "tttxt015.text"
desc  : this function is used to determine whether the field contains
        new line characters (table field tttxt010.text usually does).
 function extern long is.text.field(const string
 pre   : true return: whether field <> is a tttxt???.ctxt field
 function extern justify.and.convert.string(
                ref string string.value() mb,
                const string string.domain())
 pre   : string.domain is an existing string domain post  : string.value is:
        - justified to left, right or center
        - converted to upper or lower case
        - truncated to the domain length according to the definition of
          the domain string.domain
 function extern long language.exists(string lang(1))
 pre   : true return: whether <lang> is an existing language
 function extern string make.string.const(const string str())
 pre    : true return : str converted to a string constant as can be used in
         code such as dynamic sql or generated scripts).
         For example: - double quotes (") have been placed around str
                      - double quotes within str have been replaced
                        with 2 double quotes ("")
                      - leading or trailing spaces are NOT removed
                        from str
 function extern remove.xch.progress()
 pre   : display.xch.progress() or display.mess() must have been called
       before. post  : window used by display.xch.progress and display.mess has
 function extern string replace(
                domain daxch.str stri,
                const string pattern(),
                const string repl() )
 pre   : pattern <> "" return: stri with all occurences of pattern replaced with
repl return
        string should not exceed length of domain daxch.str
 function extern
                const string sepa.string(),
                ref domain daxch.yesno ctrl,
                ref domain daxch.sepa sepa )
 pre   : valid.separator.string(sepa.string) post  : if isspace(sepa.string):
ctrl = no  and sepa = ""
        if len(sepa.string) = 1: ctrl = no and sepa = sepa.string
        if len(sepa.string) = 2: ctrl = yes and sepa = sepa.string(2)
 function extern string
               domain daxch.yesno ctrl,
               domain daxch.sepa sepa )
 pre   : valid.separator(ctrl, sepa) return: if ctrl = no: sepa
        if ctrl = yes: the ASCII character for <Ctrl> sepa
 function extern long size.of(const string
 pre   : is a domain of type string return: the length of the domain
 function extern long table.exists(const domain daxch.ttbl
 pre   : true return: whether <> is an existing table.
 function extern long valid.separator(
                domain daxch.yesno ctrl,
                domain daxch.sepa sepa )
 pre:    true return: true if and only if ctrl and sepa make up a valid
        For example:- ctrl = no  and sepa not in {, 0--9, A--Z}
                    - ctrl = yes and sepa     in {A--Z, [, \, ], ^}
 function extern long valid.separator.string(const string sepa.string())
 pre   : true return: true if and only if sepa.string is a valid separator.
        For example:- isspace(sepa.string)
                    - len(sepa.string) = 1 and valid.separator
                      (no, sepa.string)
                    - len(sepa.string) = 2 and sepa.string(1;1)
                      = "^" and valid.separator (yes, sepa.string(2)