.CM  SCRIPT , Version - 1.1 , last edited by D.Dittmar
.pa
.ad 8
.bm 8
.fm 4
.bt $Copyright (c) 1997-2004 SAP AG$$Page %$
.tm 12
.hm 6
.hs 3
.TT 1 $SQL$Project Distributed Database System$VIN03$
.tt 2 $$$
.TT 3 $$messages$1995-11-01$
***********************************************************
.nf

.nf


    ========== licence begin  GPL
    Copyright (c) 1997-2004 SAP AG

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    ========== licence end

.fo


.fo
.nf
.sp
MODULE  : messages
=========
.sp
Purpose : Logical interface to SYSMSG and SYSLITERAL table.
.CM *-END-* purpose -------------------------------------
.sp
.cp 3
Define  :
 
        PROCEDURE
              i03db2msg (
                    msg_nr    : integer;
                    VAR msg   : tin_screenline;
                    VAR msgt  : tin_msg_type);
 
        PROCEDURE
              i03crashmsg (
                    VAR msg : tin_screenline );
 
        PROCEDURE
              i03init;
 
        PROCEDURE
              i03insert_msg (
                    msg_nr   : integer;
                    VAR msg  : tin_screenline);
 
        PROCEDURE
              i03int2msg (
                    msg_nr    : integer;
                    int2parms : tsp00_Int2;
                    VAR msg   : tin_screenline;
                    VAR msgt  : tin_msg_type );
 
        PROCEDURE
              i03literal (
                    author      : tsp00_KnlIdentifier;
                    litname     : tsp00_Name;
                    VAR literal : tin_menu_result );
 
        PROCEDURE
              i03mfetch (
                    VAR msgnos : tin_msgnos);
 
        PROCEDURE
              i03mfinit (
                    VAR msgnos : tin_msgnos);
 
        PROCEDURE
              i03mfrange (
                    msgno1     : tsp00_Int2;
                    msgno2     : tsp00_Int2;
                    VAR msgnos : tin_msgnos);
 
        PROCEDURE
              i03mfset (
                    msgno      : tsp00_Int2;
                    VAR msgnos : tin_msgnos);
 
        PROCEDURE
              i03msg (
                    msg_nr    : integer;
                    VAR parms : tin_msg_parms;
                    VAR msg   : tin_screenline;
                    VAR msgt  : tin_msg_type);
 
        PROCEDURE
              i03msg1 (
                    msg_nr  : integer;
                    VAR msg : tin_screenline);
 
        PROCEDURE
              i03negmsg (
                    msg_nr    : integer;
                    VAR parms : tin_msg_parms;
                    VAR msg   : tin_screenline;
                    VAR msgt  : tin_msg_type );
 
        PROCEDURE
              i03nummsg (
                    msg_nr    : integer;
                    VAR parms : tin_msg_parms;
                    VAR msg   : tin_screenline;
                    VAR msgt  : tin_msg_type );
 
        PROCEDURE
              i03resolve_parms (
                    VAR parms : tin_msg_parms;
                    VAR msg   : tin_screenline );
 
        PROCEDURE
              i03check_mlanguage (
                    language : tin_language_id;
                    VAR ok   : boolean);
 
        FUNCTION
              in0330 : tsp00_Int4;
 
.CM *-END-* define --------------------------------------
.sp;.cp 3
Use     :
 
        FROM
              messages : VIN04;
 
        PROCEDURE
              i04check_mlanguage (
                    g_area     : tin_global_in_vars;
                    language   : tin_language_id;
                    VAR ok     : boolean);
 
        PROCEDURE
              i04msg1 (
                    g_area  : tin_global_in_vars;
                    msg_nr  : integer;
                    VAR msg : tin_screenline);
 
        PROCEDURE
              i04db2msg (
                    g_area    : tin_global_in_vars;
                    msg_nr    : integer;
                    VAR msg   : tin_screenline;
                    VAR msgt  : tin_msg_type);
 
        PROCEDURE
              i04crashmsg (
                    g_area  : tin_global_in_vars;
                    err     : tin_connect_status;
                    VAR msg : tin_screenline);
 
        PROCEDURE
              i04init (
                    g_area : tin_global_in_vars );
 
        PROCEDURE
              i04insert_msg (
                    g_area   : tin_global_in_vars;
                    msg_nr   : integer;
                    VAR msg  : tin_screenline);
 
        PROCEDURE
              i04int2msg (
                    g_area    : tin_global_in_vars;
                    msg_nr    : integer;
                    int2parms : tsp00_Int2;
                    VAR msg   : tin_screenline;
                    VAR msgt  : tin_msg_type);
 
        PROCEDURE
              i04literal (
                    g_area      : tin_global_in_vars;
                    author      : tsp00_KnlIdentifier;
                    litname     : tsp00_Name;
                    VAR literal : tin_menu_result);
 
        PROCEDURE
              i04mfetch (
                    g_area     : tin_global_in_vars;
                    VAR msgnos : tin_msgnos);
 
        PROCEDURE
              i04mfrange (
                    msgno1     : tsp00_Int2;
                    msgno2     : tsp00_Int2;
                    VAR msgnos : tin_msgnos);
 
        PROCEDURE
              i04mfset (
                    msgno      : tsp00_Int2;
                    VAR msgnos : tin_msgnos);
 
        PROCEDURE
              i04msg (
                    g_area    : tin_global_in_vars;
                    msg_nr    : integer;
                    VAR parms : tin_msg_parms;
                    VAR msg   : tin_screenline;
                    VAR msgt  : tin_msg_type);
 
        PROCEDURE
              i04negmsg (
                    g_area    : tin_global_in_vars;
                    msg_nr    : integer;
                    VAR parms : tin_msg_parms;
                    VAR msg   : tin_screenline;
                    VAR msgt  : tin_msg_type );
 
        PROCEDURE
              i04nummsg (
                    g_area    : tin_global_in_vars;
                    msg_nr    : integer;
                    VAR parms : tin_msg_parms;
                    VAR msg   : tin_screenline;
                    VAR msgt  : tin_msg_type );
 
        PROCEDURE
              i04resolve_parms (
                    VAR parms : tin_msg_parms;
                    VAR msg   : tin_screenline);
 
        PROCEDURE
              i04sqlmsg (
                    g_area  : tin_global_in_vars;
                    msg_nr  : integer;
                    VAR msg : tin_screenline);
 
      ------------------------------ 
 
        FROM
              help: VIN05;
 
        PROCEDURE
              i05init (
                    g_area : tin_global_in_vars);
 
      ------------------------------ 
 
        FROM
              global_variable : VIN01;
 
        VAR
              i01g   : tin_global_in_vars;
 
.CM *-END-* use -----------------------------------------
.sp;.cp 3
Synonym :
 
.CM *-END-* synonym -------------------------------------
.sp;.cp 3
Author  : 
.sp
.cp 3
Created : 1986-08-04
.sp
.cp 3
Version : 1997-01-15
.sp
.cp 3
Release :  6.1.2     Date : 1995-11-01
.sp
***********************************************************
.sp
.cp 20
.fo
.oc _/1
Specification:
.sp;.hi +3
        PROCEDURE
              i03msg (
                    msg_nr   : integer;
                    VAR parms : ti_msg_parms;
                    VAR msg   : ti_screenline;
                    VAR msgt  : ti_msg_type);
 
.sp;.fo
This procedure supplies in MSG the current text for the component
COMP with the message number MSG_NR and the language determined in
SET_PARMS.
.sp;.cp 6
Current text parameters can also be supplied via the buffer PARMS.
The ith parameter in the buffer replaces &i in the text (1<=i<=9).
PARMS.BUFFER must be allocated as follows :
.br
The first byte contains the length of the first parameter ( chr (length) )
followed by the parameter, then the length byte of the second parameter
followed by the parameter, etc.
.sp;.nf;.cp 4
    Example:
    x := chr (4); y := chr (3);
    parms.buffer := 'xEXITyEND       ';
    parms.length := 9;
.sp;.fo
References that have not been deleted are ignored.
If no text_parameters are used, PARMS.LENGTH must be assigned null.
.sp;.cp 5
If the relevant message for the specified component COMP is not
currently available in I01_G.MSG_TAB, the procedure accesses the
system table SYSMSG   of the database in order to fetch the message
text.
.sp;.cp 4
The parameter MSGT reports whether it was possible to supply the message
 (LONG_MSG) or the message was not present (SHORT_MSG) or
no database access was possible (CRASH_MSG).
MSG is assigned at least one default message.
.sp 3;.cp 6;.nf
        PROCEDURE
              i03int2msg (
                          msg_nr    : integer;
                          int2parms : int2;
                          VAR msg   : ti_screenline;
                          VAR msgt  : ti_msg_type);
 
.sp;.fo
This procedure supplies in MSG the current text for the component
COMP with the message number MSG_NR and the language determined in
SET_PARMS.
.sp;.cp 6
If a '&' is contained in MSG, it is replaced by the character
presentation from INT2PARMS.
.sp;.cp 5
If the relevant message for the specified component COMP is not
currently available in I01_G.MSG_TAB, the procedure accesses the
system table SYSMSG   of the database in order to fetch the message
text.
.sp;.cp 4
The parameter MSGT reports whether it was possible to supply the message
 (LONG_MSG) or the message was not present (SHORT_MSG) or no database
access was possible (CRASH_MSG).
MSG is assigned at least one default message.
.sp;.cp 8;.nf
        PROCEDURE
              i03crashmsg (err : ti_connect_status;
                          VAR msg   : ti_screenline);
.sp 2;.fo
This procedure returns the appropriate error message to ERR
in MSG.
.sp;.cp 8;.nf
        PROCEDURE
              i03mfetch (
                          msg_nos : c60);
.sp 2;.fo
This procedure can be called at the beginning of a component (or a
new branch) in order to provide the messages more quickly.  With
MFETCH, the procedure fetches the messages that belong to the
message numbers specified in MSG_NOS.
.sp;These numbers are passed in MSG_NOS in the form of a PASCAL SET
in plain text (without parentheses!!).
.sp;Example:
.sp;.nf;.cp 10
PROCEDURE
          fetch_important_messages;
 
CONST
      most_used_messages =
        '1..13,22..30,33,34,200..205                                 ';
 
BEGIN
i03fetchmessages (appl.comp,most_used_messages);
END;
.sp 2;.fo
This procedure checks beforehand whether the messages desired have
already been loaded by taking random samples.
 (A message number is taken from the string ]
.CM *-END-* specification -------------------------------
.sp 2.fo
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Description:
The texts for all messages are located in the VDN table PUBLIC.SYSMSG  :
.sp 2;.cp 6;.nf
 CREATE TABLE PUBLIC.SYSMSG
.sp
   (
     LANGUAGE     CHAR (3)  KEY,
     MSGNO        FIXED (5) KEY,
     MSGTEXT      CHAR (80)     )
.sp 2;.fo
The texts (MSGTEXT) are read in from the database table with the procedure
EINLESEN and stored in I01_G^.MSG_TAB.MESSAGES.
The MESSAGES are sorted according to LRU.
I01_MSG).
.sp 2;.cp 12;.nf
            I01_G^.MSG_TAB
                       FIRST    : INTEGER;
                       LAST     : INTEGER;
                       EMTY     : BOOLEAN;
                       PARSID   : STRING6;
                       BUFPOS   : ARRAY [ 1..4 ] of int2;
                       MESSAGES [ 1..30 ]
                               NEXT     : INTEGER;
                               PREV     : INTEGER;
                               MSG_KEY  : MSG_KEY_TYPE;
                                        LANG : LANGUAGE_ID;
                                        NR   : INTEGER;
                               MSG_TEXT : SCREENLINE;
.sp 3
i04LITERAL
----------
.br
The language-dependent literals are located in the view
PUBLIC.SYSLITERAL.  They are entered there via the data
dictionary.  The procedure i04LITERAL is also given the name of the
literal ('litname') and the name of the "owner" ('author').  The language is
determined via the SET parameter.  If the literal being searched for
is found, the value is located in 'literal' and the length in 'llen'.
If no entry is found, the name of the literal is returned in 'literal'.
Before i04LITERAL is called for the first time, the following fields
must be initialized in the data structure LITERAL_POOL:
       length with 0,
       dbpid with bi_parseid,
       accesscount with 0 and
       sysliteral_exists with TRUE.
.CM *-END-* description ---------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.nf
.oc _/1
Structure:
 
.CM *-END-* structure -----------------------------------
.sp 2
**********************************************************
.sp
.cp 10
.nf
.oc _/1
.CM -lll-
Code    :
 
 
(*------------------------------*) 
 
FUNCTION
      in0330 : tsp00_Int4;
 
BEGIN
(* linkcheck function *)
in0330 := 219020114;
END;
 
(*------------------------------*) 
 
PROCEDURE
      i03db2msg (
            msg_nr    : integer;
            VAR msg   : tin_screenline;
            VAR msgt  : tin_msg_type);
 
BEGIN
i04db2msg (i01g, msg_nr, msg, msgt);
END; (* i03db2msg *)
 
(*------------------------------*) 
 
PROCEDURE
      i03crashmsg (
            VAR msg : tin_screenline);
 
BEGIN
i04crashmsg (i01g, i01g^.session [i01g^.dbno].connect_status, msg);
END; (* i03crashmsg *)
 
(*------------------------------*) 
 
PROCEDURE
      i03init;
 
BEGIN
i04init ( i01g );
(* MR 010293 *)
i05init ( i01g );
(* ** ****** *)
END; (* i03init *)
 
(*------------------------------*) 
 
PROCEDURE
      i03insert_msg (
            msg_nr   : integer;
            VAR msg  : tin_screenline);
 
BEGIN
i04insert_msg (i01g, msg_nr, msg);
END; (* i03insert_msg *)
 
(*------------------------------*) 
 
PROCEDURE
      i03int2msg (
            msg_nr    : integer;
            int2parms : tsp00_Int2;
            VAR msg   : tin_screenline;
            VAR msgt  : tin_msg_type);
 
BEGIN
i04int2msg (i01g, msg_nr, int2parms, msg, msgt);
END; (* i03int2msg *)
 
(*------------------------------*) 
 
PROCEDURE
      i03literal (
            author      : tsp00_KnlIdentifier;
            litname     : tsp00_Name;
            VAR literal : tin_menu_result );
 
BEGIN
i04literal (i01g, author, litname, literal);
END; (* i03literal *)
 
(* Mass Fetch *)
(*------------------------------*) 
 
PROCEDURE
      i03mfetch (
            VAR msgnos : tin_msgnos);
 
BEGIN
i04mfetch ( i01g, msgnos);
END; (* i03mfetch *)
 
(*------------------------------*) 
 
PROCEDURE
      i03mfinit (
            VAR msgnos : tin_msgnos);
 
BEGIN
msgnos.len := 0;
END; (* i03mfinit *)
 
(*------------------------------*) 
 
PROCEDURE
      i03mfrange (
            msgno1     : tsp00_Int2;
            msgno2     : tsp00_Int2;
            VAR msgnos : tin_msgnos);
 
BEGIN
i04mfrange ( msgno1, msgno2, msgnos );
END; (* i03mfrange *)
 
(*------------------------------*) 
 
PROCEDURE
      i03mfset (
            msgno      : tsp00_Int2;
            VAR msgnos : tin_msgnos);
 
BEGIN
i04mfset( msgno, msgnos );
END; (* i03mfset *)
 
(*------------------------------*) 
 
PROCEDURE
      i03msg (
            msg_nr    : integer;
            VAR parms : tin_msg_parms;
            VAR msg   : tin_screenline;
            VAR msgt  : tin_msg_type);
 
BEGIN
i04msg (i01g, msg_nr, parms, msg, msgt);
END; (* i03msg *)
 
(*------------------------------*) 
 
PROCEDURE
      i03msg1 (
            msg_nr  : integer;
            VAR msg : tin_screenline);
 
BEGIN
i04msg1 (i01g, msg_nr, msg);
END; (* i03msg1 *)
 
(*------------------------------*) 
 
PROCEDURE
      i03negmsg (
            msg_nr    : integer;
            VAR parms : tin_msg_parms;
            VAR msg   : tin_screenline;
            VAR msgt  : tin_msg_type);
 
BEGIN
i04negmsg (i01g, msg_nr, parms, msg, msgt);
END; (* i03negmsg *)
 
(*------------------------------*) 
 
PROCEDURE
      i03nummsg (
            msg_nr    : integer;
            VAR parms : tin_msg_parms;
            VAR msg   : tin_screenline;
            VAR msgt  : tin_msg_type);
 
BEGIN
i04nummsg (i01g, msg_nr, parms, msg, msgt);
END; (* i03nummsg *)
 
(*------------------------------*) 
 
PROCEDURE
      i03resolve_parms (
            VAR parms : tin_msg_parms;
            VAR msg   : tin_screenline);
 
BEGIN
i04resolve_parms (parms, msg);
END; (* i03resolve_parms *)
 
(*------------------------------*) 
 
PROCEDURE
      i03sqlmsg (
            msg_nr  : integer;
            VAR msg : tin_screenline);
 
BEGIN
i04sqlmsg (i01g, msg_nr, msg);
END; (* i03sqlmsg *)
 
(*------------------------------*) 
 
PROCEDURE
      i03check_mlanguage (
            language : tin_language_id;
            VAR ok   : boolean);
 
BEGIN
i04check_mlanguage (i01g, language, ok);
END; (* i03sqlmsg *)
 
.CM *-END-* code ----------------------------------------
.SP 2 
***********************************************************
*-PRETTY-*  statements    :         19
*-PRETTY-*  lines of code :        206        PRETTY  3.09 
*-PRETTY-*  lines in file :        644         1992-11-23 
.PA 
