.ad 8
.bm 8
.fm 4
.bt $Copyright (c) 1994-2005 SAP AG$$Page %$
.tm 12
.hm 6
.hs 3
.tt 1 $SQL$Project Distributed Database System$VSP25$
.tt 2 $$$
.tt 3 $ElkeZ$Set-Integer-Conversions$1994-01-21$
***********************************************************
.nf

.nf

.nf

    ========== licence begin  GPL
    Copyright (c) 1994-2005 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


.fo
.nf
.sp
MODULE  : Set-Integer-Conversions
=========
.sp
Purpose : Builds a warningset out of an int2 or vice versa
.CM *-END-* purpose -------------------------------------
.sp
.cp 3
Define  :
 
        PROCEDURE
              s25pwarn (ws : tsp00_WarningSet;
                    VAR warnint : tsp00_Int2);
 
        PROCEDURE
              s25gwarn (VAR ws : tsp00_WarningSet;
                    warnint : tsp00_Int2);
 
.CM *-END-* define --------------------------------------
.sp;.cp 3
Use     :
 
.CM *-END-* use -----------------------------------------
.sp;.cp 3
Synonym :
 
.CM *-END-* synonym -------------------------------------
.sp;.cp 3
Author  : ElkeZ
.sp
.cp 3
Created : 1987-08-20
.sp
.cp 3
Version : 1994-01-21
.sp
.cp 3
Release :  3.1.3 	 Date : 1994-01-21
.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
      s25pwarn (ws : tsp00_WarningSet;
            VAR warnint : tsp00_Int2);
 
VAR
      w : tsp00_Warnings;
      intval : integer;
 
BEGIN
warnint:= -32768;
intval:= 16384;
FOR w:= warn1 TO warn15_user_defined_code DO
    BEGIN
    IF  w in ws
    THEN
        warnint:= warnint + intval;
    (*ENDIF*) 
    intval:= intval DIV 2
    END
(*ENDFOR*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      s25gwarn (VAR ws : tsp00_WarningSet;
            warnint : tsp00_Int2);
 
VAR
      i : tsp00_Int2;
      w : tsp00_Warnings;
      intval : integer;
 
BEGIN
ws:= [ warn0_exist ];
i:= -32768;
intval:= 16384;
FOR w:= warn1 TO warn15_user_defined_code DO
    BEGIN
    IF  i + intval <= warnint
    THEN
        BEGIN
        i:= i + intval;
        ws:= ws + [ w ]
        END;
    (*ENDIF*) 
    intval:= intval DIV 2
    END
(*ENDFOR*) 
END;
 
.CM *-END-* code ----------------------------------------
.SP 2 
***********************************************************
*-PRETTY-*  statements    :         14
*-PRETTY-*  lines of code :         52        PRETTY  3.09 
*-PRETTY-*  lines in file :        149         1992-11-23 
.PA 
