.ad 8
.bm 8
.fm 4
.bt $Copyright (c) 1998-2004 SAP AG$$Page %$
.tm 12
.hm 6
.hs 3
.tt 1 $SQL$Project Distributed Database System$VSP99$
.tt 2 $$$
.tt 3 $$link check msg$1998-05-25$
***********************************************************
.nf

.nf


    ========== licence begin  GPL
    Copyright (c) 1998-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  : link_check_msg
=========
.sp
Purpose : This module generates a 64 char long msg line
          for the linkcheck errors.
.CM *-END-* purpose -------------------------------------
.sp
.cp 3
Define  :
 
        PROCEDURE
              s99linkcheckmsg (
                    VAR msg      : tsp00_C64;
                    check_module : tsp00_Int4;
                    stamp_date   : tsp00_Int4;
                    module_name  : tsp00_C4);
 
.CM *-END-* define --------------------------------------
.sp;.cp 3
Use     :
 
.CM *-END-* use -----------------------------------------
.sp;.cp 3
Synonym :
 
.CM *-END-* synonym -------------------------------------
.sp;.cp 3
Author  : 
.sp
.cp 3
Created : 1990-07-25
.sp
.cp 3
Version : 1998-05-25
.sp
.cp 3
Release :      Date : 1998-05-25
.sp
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Specification:
.CM *-END-* specification -------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Description:
.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    :
 
 
(*------------------------------*) 
 
PROCEDURE
      s99linkcheckmsg (
            VAR msg      : tsp00_C64;
            check_module : tsp00_Int4;
            stamp_date   : tsp00_Int4;
            module_name  : tsp00_C4);
 
VAR
      date_in_module : tsp00_Int4;
      i              : integer;
      retcode        : integer;
      helpname       : tsp00_Name;
 
BEGIN
(*         10        20        30        40        50        60    *)
(* 123456789-123456789-123456789-123456789-123456789-123456789-1234*)
(*                        module_name                              *)
(*               check_module      check_module         stamp_date *)
(* linkcheck value '1234' in VAK36 (1990-07-25) differs from '1234'*)
(*  *)
&ifndef nocheck
date_in_module := check_module DIV 100000;
IF  NOT (date_in_module = stamp_date)
THEN
    BEGIN
    retcode   := -9876;
    helpname  := 'linkcheck value ..';
    FOR i := 1 TO mxsp_c64 DO
        msg [ i ] := '*';
    (*ENDFOR*) 
    FOR i := 1 TO 16 DO
        msg [ i ] := helpname[ i ];
    (*ENDFOR*) 
    msg[ 17 ] := '''';
    sp99int (date_in_module, 4, 18, msg);
    msg[ 22 ] := '''';
    msg[ 23 ] := ' ';
    msg[ 24 ] := 'i';
    msg[ 25 ] := 'n';
    msg[ 26 ] := ' ';
    msg[ 27 ] := 'V';
    FOR i := 1 TO 4 DO
        msg [ 27+i ] := module_name[ i ];
    (*ENDFOR*) 
    msg[ 32 ] := ' ';
    msg[ 33 ] := '(';
    msg[ 34 ] := '1';
    msg[ 35 ] := '9';
    (* ----- jahr ----- *)
    i := ((check_module DIV 10000) - ((check_module DIV 100000) * 10));
    IF  (i <= 9) AND (i > 5)
    THEN
        (* 1986..89 *)
        msg[ 36 ] := '8'
    ELSE
        (* 1990..95 *)
        msg[ 36 ] := '9';
    (*ENDIF*) 
    sp99int (i, 1, 37, msg);
    msg[ 38 ] := '-';
    (* ----- monat ----- *)
    i := ((check_module DIV 100) - ((check_module DIV 10000) * 100));
    IF  i < 10
    THEN
        BEGIN
        msg[ 39 ] := '0';
        sp99int (i, 1, 40, msg);
        END
    ELSE
        sp99int (i, 2, 39, msg);
    (*ENDIF*) 
    msg[ 41 ] := '-';
    (* ----- tag ----- *)
    i := (check_module MOD (check_module DIV 100));
    IF  i < 10
    THEN
        BEGIN
        msg[ 42 ] := '0';
        sp99int (i, 1, 43, msg);
        END
    ELSE
        sp99int (i, 2, 42, msg);
    (*ENDIF*) 
    helpname := ') differs from ...';
    FOR i := 1 TO 15 DO
        msg [ 43+i ] := helpname[ i ];
    (*ENDFOR*) 
    msg[ 59 ] := '''';
    sp99int (stamp_date, 4, 60, msg);
    msg[ 64 ] := '''';
    END
&endif
(*ENDIF*) 
END;
 
&ifndef nocheck
(*------------------------------*) 
 
PROCEDURE
      sp99int (int : tsp00_Int4;
            int_len     : integer;
            ln_pos      : integer;
            VAR ln      : tsp00_C64);
 
VAR
      rem : tsp00_Int4;
      i   : integer;
 
BEGIN
IF  int < 0
THEN
    rem := -int
ELSE
    rem := int;
(*ENDIF*) 
FOR i := int_len DOWNTO 1 DO
    BEGIN
    ln[ ln_pos+i-1 ] := chr((rem MOD 10) + ord('0'));
    rem := rem DIV 10
    END;
(*ENDFOR*) 
IF  rem > 0
THEN (* overflow *)
    ln[ ln_pos ] := '*'
ELSE
    BEGIN
    i := ln_pos;
    WHILE (i < ln_pos + int_len - 1) AND (ln[ i ] = '0') DO
        BEGIN
        ln[ i ] := ' ';
        i := i + 1
        END;
    (*ENDWHILE*) 
    IF  int < 0
    THEN
        BEGIN
        IF  i > ln_pos
        THEN
            ln[ i-1 ] := '-'
        ELSE (* underflow *)
            ln[ ln_pos ] := '*'
        (*ENDIF*) 
        END
    (*ENDIF*) 
    END
(*ENDIF*) 
END;
 
&endif
 
.CM *-END-* code ----------------------------------------
.SP 2 
***********************************************************
*-PRETTY-*  statements    :         64
*-PRETTY-*  lines of code :        192        PRETTYX 3.10 
*-PRETTY-*  lines in file :        290         1997-12-10 
.PA 
