× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I like the idea of the %min %max functions.

I had a need for the min max functions years ago, so I just created a few specific ones and dropped them into a utility service program.
Was done in under an hour.



P Utl_MaxChar B EXPORT
//===================================================================
//===================================================================
// @Procedure name: Utl_MaxChar
//===================================================================
//===================================================================
D Utl_MaxChar PI 65535A VARYING
D nValue1 65535A VARYING OPTIONS(*VARSIZE) CONST
D nValue2 65535A VARYING OPTIONS(*VARSIZE) CONST
D nValue3 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nValue4 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nValue5 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nValue6 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nValue7 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nValue8 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nValue9 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nValue10 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)

D nMax S 10I 0 INZ

/free
// We could have coded this procedure like the MaxNum or MaxDate,
// however we wanted to make the program more efficient when large
// fields were passed in. In the other procedures we save a copy
// of the input which is the Maximum. Here instead of copying
// 65k every time, we just keep an "Index" number representing
// the parm that is the Maximum parm.
// This makes it so the program doesn't have to create a copy
// of the input every time then next parm needs to become the max parm.

nMax = 0;
If (%parms() < 1);
Return *BLANKS;
ENDIF;
// Save the parm position of the Maximum parm I.e. nMax = %PARMNUM(nValue1)
nMax = 1;

if (%parms()>= 2 and nValue1 < nValue2);
nMax = 2;
endif;

// Now, use nMax value to choose which parm we want to compare to parm 3
if %parms()>= 3 and (nMax=1 AND nValue1 < nValue3
OR nMax=2 AND nValue2 < nValue3);
// v7r1 nMax = %PARMNUM(nValue3);
nMax = 3;
endif;

// Now, use nMax value to choose which parm we want to compare to parm 4
if %parms()>= 4 and (nMax=1 AND nValue1 < nValue4
OR nMax=2 AND nValue2 < nValue4
OR nMax=3 AND nValue3 < nValue4);
// v7r1 nMax = %PARMNUM(nValue4);
nMax = 4;
endif;

if %parms()>= 5 and (nMax=1 AND nValue1 < nValue5
OR nMax=2 AND nValue2 < nValue5
OR nMax=3 AND nValue3 < nValue5
OR nMax=4 AND nValue4 < nValue5);
nMax = 5;
endif;

if %parms()>= 6 and (nMax=1 AND nValue1 < nValue6
OR nMax=2 AND nValue2 < nValue6
OR nMax=3 AND nValue3 < nValue6
OR nMax=4 AND nValue4 < nValue6
OR nMax=5 AND nValue5 < nValue6);
nMax = 6;
endif;

if %parms()>= 7 and (nMax=1 AND nValue1 < nValue7
OR nMax=2 AND nValue2 < nValue7
OR nMax=3 AND nValue3 < nValue7
OR nMax=4 AND nValue4 < nValue7
OR nMax=5 AND nValue5 < nValue7
OR nMax=6 AND nValue6 < nValue7);
nMax = 7;
endif;

if %parms()>= 8 and (nMax=1 AND nValue1 < nValue8
OR nMax=2 AND nValue2 < nValue8
OR nMax=3 AND nValue3 < nValue8
OR nMax=4 AND nValue4 < nValue8
OR nMax=5 AND nValue5 < nValue8
OR nMax=6 AND nValue6 < nValue8
OR nMax=7 AND nValue7 < nValue8);
nMax = 8;
endif;

if %parms()>= 9 and (nMax=1 AND nValue1 < nValue9
OR nMax=2 AND nValue2 < nValue9
OR nMax=3 AND nValue3 < nValue9
OR nMax=4 AND nValue4 < nValue9
OR nMax=5 AND nValue5 < nValue9
OR nMax=6 AND nValue6 < nValue9
OR nMax=7 AND nValue7 < nValue9
OR nMax=8 AND nValue8 < nValue9);
nMax = 9;
endif;

if %parms()>= 10 and (nMax=1 AND nValue1 < nValue10
OR nMax=2 AND nValue2 < nValue10
OR nMax=3 AND nValue3 < nValue10
OR nMax=4 AND nValue4 < nValue10
OR nMax=5 AND nValue5 < nValue10
OR nMax=6 AND nValue6 < nValue10
OR nMax=7 AND nValue7 < nValue10
OR nMax=8 AND nValue8 < nValue10
OR nMax=9 AND nValue9 < nValue10);
nMax = 10;
endif;

SELECT;
WHEN nMax = 1;
return nValue1;
WHEN nMax = 2;
return nValue2;
WHEN nMax = 3;
return nValue3;
WHEN nMax = 4;
return nValue4;
WHEN nMax = 5;
return nValue5;
WHEN nMax = 6;
return nValue6;
WHEN nMax = 7;
return nValue7;
WHEN nMax = 8;
return nValue8;
WHEN nMax = 9;
return nValue9;
WHEN nMax = 10;
return nValue10;
OTHER;
return nValue1;
ENDSL;
/end-free
P Utl_MaxChar E

P Utl_MaxDate B EXPORT
//===================================================================
//===================================================================
// @Procedure name: Utl_MaxDate
//===================================================================
//===================================================================
D Utl_MaxDate PI D DATFMT(*ISO)
D nValue1 D DATFMT(*ISO) Const
D nValue2 D DATFMT(*ISO) Const
D nValue3 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nValue4 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nValue5 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nValue6 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nValue7 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nValue8 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nValue9 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nValue10 D DATFMT(*ISO) Const OPTIONS(*NOPASS)

D nMax S D DATFMT(*ISO)

/free
If (%parms() < 1);
nMax = *HIVAL;
Return nMax;
ELSE;
nMax = nValue1;
Endif;

If %PARMS() < 2;
Return nMax;
Endif;
If (nMax < nValue2);
nMax = nValue2;
Endif;

If %PARMS() < 3;
Return nMax;
Endif;
If (nMax < nValue3);
nMax = nValue3;
Endif;

If %PARMS() < 4;
Return nMax;
Endif;
If (nMax < nValue4);
nMax = nValue4;
Endif;

If %PARMS() < 5;
Return nMax;
Endif;
If (nMax < nValue5);
nMax = nValue5;
Endif;

If %PARMS() < 6;
Return nMax;
Endif;
If (nMax < nValue6);
nMax = nValue6;
Endif;

If %PARMS() < 7;
Return nMax;
Endif;
If (nMax < nValue7);
nMax = nValue7;
Endif;

If %PARMS() < 8;
Return nMax;
Endif;
If (nMax < nValue8);
nMax = nValue8;
Endif;

If %PARMS() < 9;
Return nMax;
Endif;
If (nMax < nValue9);
nMax = nValue9;
Endif;

If %PARMS() < 10;
Return nMax;
Endif;
If (nMax < nValue10);
nMax = nValue10;
Endif;

return nMax;
/end-free
P Utl_MaxDate E


P Utl_MaxNum B EXPORT
//===================================================================
//===================================================================
// @Procedure name: Utl_MaxNum
//===================================================================
//if max (
// max( val1: val2)
// : max( val1: val2) );
//===================================================================
D Utl_MaxNum PI 30P 9
D nValue1 30P 9 Const
D nValue2 30P 9 Const
D nValue3 30P 9 Const OPTIONS(*NOPASS)
D nValue4 30P 9 Const OPTIONS(*NOPASS)
D nValue5 30P 9 Const OPTIONS(*NOPASS)
D nValue6 30P 9 Const OPTIONS(*NOPASS)
D nValue7 30P 9 Const OPTIONS(*NOPASS)
D nValue8 30P 9 Const OPTIONS(*NOPASS)
D nValue9 30P 9 Const OPTIONS(*NOPASS)
D nValue10 30P 9 Const OPTIONS(*NOPASS)

D nMax S 30P 9

/free
If (%parms() < 1);
nMax = 0;
ELSE;
nMax = nValue1;
Endif;

If %PARMS() < 2;
Return nMax;
Endif;
If (nMax < nValue2);
nMax = nValue2;
Endif;

If %PARMS() < 3;
Return nMax;
Endif;
If (nMax < nValue3);
nMax = nValue3;
Endif;

If %PARMS() < 4;
Return nMax;
Endif;
If (nMax < nValue4);
nMax = nValue4;
Endif;

If %PARMS() < 5;
Return nMax;
Endif;
If (nMax < nValue5);
nMax = nValue5;
Endif;

If %PARMS() < 6;
Return nMax;
Endif;
If (nMax < nValue6);
nMax = nValue6;
Endif;

If %PARMS() < 7;
Return nMax;
Endif;
If (nMax < nValue7);
nMax = nValue7;
Endif;

If %PARMS() < 8;
Return nMax;
Endif;
If (nMax < nValue8);
nMax = nValue8;
Endif;

If %PARMS() < 9;
Return nMax;
Endif;
If (nMax < nValue9);
nMax = nValue9;
Endif;

If %PARMS() < 10;
Return nMax;
Endif;
If (nMax < nValue10);
nMax = nValue10;
Endif;

return nMax;
/end-free
P Utl_MaxNum E


P Utl_MinChar B EXPORT
//===================================================================
//===================================================================
// @Procedure name: Utl_MinChar
//===================================================================
//===================================================================
D Utl_MinChar PI 65535A VARYING
D nValue1 65535A VARYING OPTIONS(*VARSIZE) CONST
D nValue2 65535A VARYING OPTIONS(*VARSIZE) CONST
D nValue3 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nValue4 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nValue5 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nValue6 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nValue7 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nValue8 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nValue9 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nValue10 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)

D nMin S 10I 0 INZ

/free
// We could have coded this procedure like the MinNum or MinDate,
// however we wanted to make the program more efficient when large
// fields were passed in. In the other procedures we save a copy
// of the input which is the Minimum. Here instead of copying
// 65k every time, we just keep an "Index" number representing
// the parm that is the Minimum parm.
// This makes it so the program doesn't have to create a copy
// of the input every time then next parm needs to become the max parm.

nMin = 0;
If (%parms() < 1);
Return *BLANKS;
ENDIF;
nMin = 1;

if (%parms()>= 2 and nValue1 > nValue2);
nMin = 2;
endif;

if %parms()>= 3 and (nMin=1 AND nValue1 > nValue3
OR nMin=2 AND nValue2 > nValue3);
nMin = 3;
endif;

if %parms()>= 4 and (nMin=1 AND nValue1 > nValue4
OR nMin=2 AND nValue2 > nValue4
OR nMin=3 AND nValue3 > nValue4);
nMin = 4;
endif;

if %parms()>= 5 and (nMin=1 AND nValue1 > nValue5
OR nMin=2 AND nValue2 > nValue5
OR nMin=3 AND nValue3 > nValue5
OR nMin=4 AND nValue4 > nValue5);
nMin = 5;
endif;

if %parms()>= 6 and (nMin=1 AND nValue1 > nValue6
OR nMin=2 AND nValue2 > nValue6
OR nMin=3 AND nValue3 > nValue6
OR nMin=4 AND nValue4 > nValue6
OR nMin=5 AND nValue5 > nValue6);
nMin = 6;
endif;

if %parms()>= 7 and (nMin=1 AND nValue1 > nValue7
OR nMin=2 AND nValue2 > nValue7
OR nMin=3 AND nValue3 > nValue7
OR nMin=4 AND nValue4 > nValue7
OR nMin=5 AND nValue5 > nValue7
OR nMin=6 AND nValue6 > nValue7);
nMin = 7;
endif;

if %parms()>= 8 and (nMin=1 AND nValue1 > nValue8
OR nMin=2 AND nValue2 > nValue8
OR nMin=3 AND nValue3 > nValue8
OR nMin=4 AND nValue4 > nValue8
OR nMin=5 AND nValue5 > nValue8
OR nMin=6 AND nValue6 > nValue8
OR nMin=7 AND nValue7 > nValue8);
nMin = 8;
endif;

if %parms()>= 9 and (nMin=1 AND nValue1 > nValue9
OR nMin=2 AND nValue2 > nValue9
OR nMin=3 AND nValue3 > nValue9
OR nMin=4 AND nValue4 > nValue9
OR nMin=5 AND nValue5 > nValue9
OR nMin=6 AND nValue6 > nValue9
OR nMin=7 AND nValue7 > nValue9
OR nMin=8 AND nValue8 > nValue9);
nMin = 9;
endif;

if %parms()>= 10 and (nMin=1 AND nValue1 > nValue10
OR nMin=2 AND nValue2 > nValue10
OR nMin=3 AND nValue3 > nValue10
OR nMin=4 AND nValue4 > nValue10
OR nMin=5 AND nValue5 > nValue10
OR nMin=6 AND nValue6 > nValue10
OR nMin=7 AND nValue7 > nValue10
OR nMin=8 AND nValue8 > nValue10
OR nMin=9 AND nValue9 > nValue10);
nMin = 10;
endif;

SELECT;
WHEN nMin = 1;
return nValue1;
WHEN nMin = 2;
return nValue2;
WHEN nMin = 3;
return nValue3;
WHEN nMin = 4;
return nValue4;
WHEN nMin = 5;
return nValue5;
WHEN nMin = 6;
return nValue6;
WHEN nMin = 7;
return nValue7;
WHEN nMin = 8;
return nValue8;
WHEN nMin = 9;
return nValue9;
WHEN nMin = 10;
return nValue10;
OTHER;
return nValue1;
ENDSL;
/end-free
P Utl_MinChar E

P Utl_MinDate B EXPORT
//===================================================================
//===================================================================
// @Procedure name: Utl_MinDate
//===================================================================
//===================================================================
D Utl_MinDate PI D DATFMT(*ISO)
D nValue1 D DATFMT(*ISO) Const
D nValue2 D DATFMT(*ISO) Const
D nValue3 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nValue4 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nValue5 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nValue6 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nValue7 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nValue8 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nValue9 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nValue10 D DATFMT(*ISO) Const OPTIONS(*NOPASS)

D nMin S D DATFMT(*ISO)

/free
If (%parms() < 1);
nMin = *LOVAL;
Return nMin;
ELSE;
nMin = nValue1;
Endif;

If %PARMS() < 2;
Return nMin;
Endif;
If (nMin > nValue2);
nMin = nValue2;
Endif;

If %PARMS() < 3;
Return nMin;
Endif;
If (nMin > nValue3);
nMin = nValue3;
Endif;

If %PARMS() < 4;
Return nMin;
Endif;
If (nMin > nValue4);
nMin = nValue4;
Endif;

If %PARMS() < 5;
Return nMin;
Endif;
If (nMin > nValue5);
nMin = nValue5;
Endif;

If %PARMS() < 6;
Return nMin;
Endif;
If (nMin > nValue6);
nMin = nValue6;
Endif;

If %PARMS() < 7;
Return nMin;
Endif;
If (nMin > nValue7);
nMin = nValue7;
Endif;

If %PARMS() < 8;
Return nMin;
Endif;
If (nMin > nValue8);
nMin = nValue8;
Endif;

If %PARMS() < 9;
Return nMin;
Endif;
If (nMin > nValue9);
nMin = nValue9;
Endif;

If %PARMS() < 10;
Return nMin;
Endif;
If (nMin > nValue10);
nMin = nValue10;
Endif;

return nMin;
/end-free
P Utl_MinDate E

P Utl_MinNum B EXPORT
//===================================================================
//===================================================================
// @Procedure name: Utl_MinNum
//===================================================================
//===================================================================
D Utl_MinNum PI 30P 9
D nValue1 30P 9 Const
D nValue2 30P 9 Const
D nValue3 30P 9 Const OPTIONS(*NOPASS)
D nValue4 30P 9 Const OPTIONS(*NOPASS)
D nValue5 30P 9 Const OPTIONS(*NOPASS)
D nValue6 30P 9 Const OPTIONS(*NOPASS)
D nValue7 30P 9 Const OPTIONS(*NOPASS)
D nValue8 30P 9 Const OPTIONS(*NOPASS)
D nValue9 30P 9 Const OPTIONS(*NOPASS)
D nValue10 30P 9 Const OPTIONS(*NOPASS)

D nMin S 30P 9

/free
If (%parms() < 1);
nMin = 0;
ELSE;
nMin = nValue1;
Endif;

If %PARMS() < 2;
Return nMin;
Endif;
If (nMin > nValue2);
nMin = nValue2;
Endif;

If %PARMS() < 3;
Return nMin;
Endif;
If (nMin > nValue3);
nMin = nValue3;
Endif;

If %PARMS() < 4;
Return nMin;
Endif;
If (nMin > nValue4);
nMin = nValue4;
Endif;

If %PARMS() < 5;
Return nMin;
Endif;
If (nMin > nValue5);
nMin = nValue5;
Endif;

If %PARMS() < 6;
Return nMin;
Endif;
If (nMin > nValue6);
nMin = nValue6;
Endif;

If %PARMS() < 7;
Return nMin;
Endif;
If (nMin > nValue7);
nMin = nValue7;
Endif;

If %PARMS() < 8;
Return nMin;
Endif;
If (nMin > nValue8);
nMin = nValue8;
Endif;

If %PARMS() < 9;
Return nMin;
Endif;
If (nMin > nValue9);
nMin = nValue9;
Endif;

If %PARMS() < 10;
Return nMin;
Endif;
If (nMin > nValue10);
nMin = nValue10;
Endif;

return nMin;
/end-free
P Utl_MinNum E

P Utl_InCharList B EXPORT
//===================================================================
//===================================================================
// @Procedure name: Utl_InCharList
//===================================================================
//===================================================================
D Utl_InCharList PI 1N
D nCompareValue 65535A VARYING OPTIONS(*VARSIZE) CONST
D*
D nListValue1 65535A VARYING OPTIONS(*VARSIZE) CONST
D nListValue2 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nListValue3 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nListValue4 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nListValue5 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nListValue6 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nListValue7 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nListValue8 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nListValue9 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D nListValue10 65535A VARYING CONST
D OPTIONS(*VARSIZE:*NOPASS)
D/FREE
IF %PARMS() < 2;
RETURN *OFF;
ENDIF;

IF nCompareValue = nListValue1;
Return *ON;
ENDIF;

If %PARMS() < 3;
Return *OFF;
Endif;
If (nCompareValue = nListValue2);
Return *on;
Endif;

If %PARMS() < 4;
Return *OFF;
Endif;
If (nCompareValue = nListValue3);
Return *on;
Endif;

If %PARMS() < 5;
Return *OFF;
Endif;
If (nCompareValue = nListValue4);
Return *on;
Endif;

If %PARMS() < 6;
Return *OFF;
Endif;
If (nCompareValue = nListValue5);
Return *on;
Endif;

If %PARMS() < 7;
Return *OFF;
Endif;
If (nCompareValue = nListValue6);
Return *on;
Endif;

If %PARMS() < 8;
Return *OFF;
Endif;
If (nCompareValue = nListValue7);
Return *on;
Endif;

If %PARMS() < 9;
Return *OFF;
Endif;
If (nCompareValue = nListValue8);
Return *on;
Endif;

If %PARMS() < 10;
Return *OFF;
Endif;
If (nCompareValue = nListValue9);
Return *on;
Endif;

If %PARMS() < 11;
Return *OFF;
Endif;
If (nCompareValue = nListValue10);
Return *on;
Endif;

Return *OFF;

/END-FREE
P Utl_InCharList E

P Utl_InDateList B EXPORT
//===================================================================
//===================================================================
// @Procedure name: Utl_InDateList
//===================================================================
//===================================================================
D Utl_InDateList PI 1N
D nCompareValue D DATFMT(*ISO) Const
D*
D nListValue1 D DATFMT(*ISO) Const
D nListValue2 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nListValue3 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nListValue4 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nListValue5 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nListValue6 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nListValue7 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nListValue8 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nListValue9 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D nListValue10 D DATFMT(*ISO) Const OPTIONS(*NOPASS)
D/FREE
IF %PARMS() < 2;
RETURN *OFF;
ENDIF;

IF nCompareValue = nListValue1;
Return *ON;
ENDIF;

If %PARMS() < 3;
Return *OFF;
Endif;
If (nCompareValue = nListValue2);
Return *on;
Endif;

If %PARMS() < 4;
Return *OFF;
Endif;
If (nCompareValue = nListValue3);
Return *on;
Endif;

If %PARMS() < 5;
Return *OFF;
Endif;
If (nCompareValue = nListValue4);
Return *on;
Endif;

If %PARMS() < 6;
Return *OFF;
Endif;
If (nCompareValue = nListValue5);
Return *on;
Endif;

If %PARMS() < 7;
Return *OFF;
Endif;
If (nCompareValue = nListValue6);
Return *on;
Endif;

If %PARMS() < 8;
Return *OFF;
Endif;
If (nCompareValue = nListValue7);
Return *on;
Endif;

If %PARMS() < 9;
Return *OFF;
Endif;
If (nCompareValue = nListValue8);
Return *on;
Endif;

If %PARMS() < 10;
Return *OFF;
Endif;
If (nCompareValue = nListValue9);
Return *on;
Endif;

If %PARMS() < 11;
Return *OFF;
Endif;
If (nCompareValue = nListValue10);
Return *on;
Endif;

Return *OFF;

/END-FREE
P Utl_InDateList E

P Utl_InNumList B EXPORT
//===================================================================
//===================================================================
// @Procedure name: Utl_InNumList
//===================================================================
//===================================================================
D Utl_InNumList PI 1N
D nCompareValue 30P 9 Const
D*
D nListValue1 30P 9 Const
D nListValue2 30P 9 Const OPTIONS(*NOPASS)
D nListValue3 30P 9 Const OPTIONS(*NOPASS)
D nListValue4 30P 9 Const OPTIONS(*NOPASS)
D nListValue5 30P 9 Const OPTIONS(*NOPASS)
D nListValue6 30P 9 Const OPTIONS(*NOPASS)
D nListValue7 30P 9 Const OPTIONS(*NOPASS)
D nListValue8 30P 9 Const OPTIONS(*NOPASS)
D nListValue9 30P 9 Const OPTIONS(*NOPASS)
D nListValue10 30P 9 Const OPTIONS(*NOPASS)
D/FREE
IF %PARMS() < 2;
RETURN *OFF;
ENDIF;

IF nCompareValue = nListValue1;
Return *ON;
ENDIF;

If %PARMS() < 3;
Return *OFF;
Endif;
If (nCompareValue = nListValue2);
Return *on;
Endif;

If %PARMS() < 4;
Return *OFF;
Endif;
If (nCompareValue = nListValue3);
Return *on;
Endif;

If %PARMS() < 5;
Return *OFF;
Endif;
If (nCompareValue = nListValue4);
Return *on;
Endif;

If %PARMS() < 6;
Return *OFF;
Endif;
If (nCompareValue = nListValue5);
Return *on;
Endif;

If %PARMS() < 7;
Return *OFF;
Endif;
If (nCompareValue = nListValue6);
Return *on;
Endif;

If %PARMS() < 8;
Return *OFF;
Endif;
If (nCompareValue = nListValue7);
Return *on;
Endif;

If %PARMS() < 9;
Return *OFF;
Endif;
If (nCompareValue = nListValue8);
Return *on;
Endif;

If %PARMS() < 10;
Return *OFF;
Endif;
If (nCompareValue = nListValue9);
Return *on;
Endif;

If %PARMS() < 11;
Return *OFF;
Endif;
If (nCompareValue = nListValue10);
Return *on;
Endif;

Return *OFF;

/END-FREE
P Utl_InNumList E

Chris Hiebert
Senior Programmer/Analyst
Disclaimer: Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.