<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/da/onlinemanual/000048" xml:lang="en">
	<Header>
		<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">dadllcommon</Title>
	</Header>
	<GeneralSection><GeneralSection><SectionTitle>DLL Usage description</SectionTitle>
			<Paragraph class="Default">Library: dadllcommon</Paragraph>
			<Paragraph class="Default">This library contains common functionality that does not belong to any other, more specific library.</Paragraph>
			<Paragraph class="Default">Unless specified otherwise the following formats should be used for passing parameters/can be expected as return value:</Paragraph>
			<Formula space-and-orientation="indented-estimated"><Paragraph class="Default"> table     : ppmmmnnn tablefield: ppmmmnnn.ccccccccc domain    :
ppcccccccccccc
</Paragraph>
			</Formula>
		</GeneralSection>
		<GeneralSection><SectionTitle>DLL Prototypes</SectionTitle>
			<Formula space-and-orientation="indented-estimated"><Paragraph class="Default"> function extern convert.char.to.new.line(ref string text.line())
 pre  : true post : in text.line all ASCII characters 255 are replaced with new
line
       characters.
 function extern convert.new.line.to.char(ref string text.line())
 pre   : true post  : in text.line all new line characters are replaced with
ASCII
       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
display.xch.progress()
 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.read,
                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:

+------------------------FFFFFFxch_typeFFFFFF-------------------+
| 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                                        |
|                                                               |
| File           : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF          |
|                                                               |
|           FFFFFFFFFFFFFFuser_messageFFFFFFFFFFFFFF            |
+---------------------------------------------------------------+

 function extern long domain.exists(const string domain.name())
 pre   : true return: whether &lt;domain.name&gt; is an existing domain
 function extern long field.exists(
                const domain daxch.ttbl table.name,
                const domain daxch.tfld field.name,
                [ ref string domain.name() ],
                [ ref long field.type ],
                [ ref long field.flag ],
                [ ref long field.depth ])
 pre   : format of field.name is without table return: whether &lt;field.name&gt; is
an existing field of table &lt;table.name&gt;
        (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 get.index.field.name(
                const string tble(),
                long index.no,
                long part.no )
 pre   : index.no &gt; 0 return: the name of the &lt;part.no&gt;th field in index
&lt;index.no&gt; of table
        &lt;tble&gt;. IF either &lt;tble&gt; does not exist or &lt;tble&gt; does not have
        an index &lt;index.no&gt; or index &lt;index.no&gt; does not have at least
        &lt;part.no&gt; 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 ==&gt; sepa.to.sepa.char
        (daxch001.ctrl,daxch001.sepa) otherwise ==&gt; "" state : current record of
daxch001 will not be changed
 function extern long index.exists(
                const domain daxch.ttbl table.name,
                long index.no,
                [ ref long no.parts ],
                [ ref long duplicate ] )
 pre   : true return: whether &lt;table.name&gt; has an index with number &lt;index.no&gt;.
post  : if true is returned the no.parts 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(),
                long index.no,
                string field.name(18) fixed )
 pre   : index.no &gt; 0 return: whether field &lt;field.name&gt; belongs to index
&lt;index.no&gt; of
        table &lt;tble&gt;
 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 field.name())
 pre   : true return: whether &lt;field.name&gt; 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 field.name())
 pre   : true return: whether field &lt;field.name&gt; 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 &lt;lang&gt; 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
literal
         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
been
       removed.
 function extern string replace(
                domain daxch.str stri,
                const string pattern(),
                const string repl() )
 pre   : pattern &lt;&gt; "" return: stri with all occurences of pattern replaced with
repl return
        string should not exceed length of domain daxch.str
 function extern sepa.string.to.sepa(
                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 sepa.to.sepa.char(
               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 &lt;Ctrl&gt; sepa
 function extern long size.of(const string domain.name())
 pre   : domain.name is a domain of type string return: the length of the domain
 function extern long table.exists(const domain daxch.ttbl table.name)
 pre   : true return: whether &lt;table.name&gt; 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
separator.
        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)
</Paragraph>
			</Formula>
		</GeneralSection>
	</GeneralSection>
	<RelatedTopics><SectionTitle>
                              Related topics
                           </SectionTitle>
		<RelTopic><Link href="/baanerp/da/onlinemanual/000102" role="manual">Libraries</Link>
		</RelTopic>
	</RelatedTopics>
</ManualTopic>
