project BLF > class BNumber > method ValMaxYear

validation procedure

Description

Year must not be greater than 9999.


Parameters


iiTargetFieldinputintegerValue of the business field to validate.
icTargetFieldNameinputcharacterName of the business field to validate.
icRowidinputcharacterContents of field tc_Rowid, if the target field is a field of a component temp-table.
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


BLF
validation on tNumbr.NumbrYear


program code (program1/bnumber.p)

oiReturnStatus = -98.

if iiTargetField > 9999
then do: 
   assign vcNumbrMsg  = trim(substitute(#T-2'The maximum value for the year (&1) is 9999.':200(503)t-2#, trim(string(iiTargetField)) ))
          oiReturnStatus = -1.
   <M-1 run SetMessage
          (input  vcNumbrMsg (icMessage), 
           input  '':U (icArguments), 
           input  icTargetFieldName (icFieldName), 
           input  string(iiTargetField) (icFieldValue), 
           input  'E':U (icType), 
           input  3 (iiSeverity), 
           input  tNumbr.tc_Rowid (icRowid), 
           input  'BLF-127':U (icFcMsgNumber), 
           input  '' (icFcExplanation), 
           input  '' (icFcIdentification), 
           input  '' (icFcContext), 
           output viFcReturnSuper (oiReturnStatus)) in BNumber>
end.

if oiReturnStatus = -98
then oiReturnStatus = 0.