project BLF > class BBaseDaemon > method ValWriteDirectory
validation procedure
Description
Validate that an entered directory name does not contain any trailing spaces and return an error if it does.
Parameters
icTargetField | input | character | Value of the business field to validate. |
icTargetFieldName | input | character | Name of the business field to validate. |
icRowid | input | character | Contents of field tc_Rowid, if the target field is a field of a component temp-table. |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
BLF
program code (program1/bbasedaemon.p)
/* do not validate if not filled in */
if icTargetField = ""
or icTargetField = ?
then return.
/* ================================================================= */
/* Directory should not end with space characters. */
/* (file-info does not detect this) */
/* ================================================================= */
if length(icTargetField,"CHARACTER":U) <> length(right-trim(icTargetField),"CHARACTER":U)
then do:
<M-3 run SetMessage
(input #T-3'Clear trailing spaces from the directory name.':255(5112)T-3# (icMessage),
input '' (icArguments),
input icTargetFieldName (icFieldName),
input icTargetField (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input icRowid (icRowid),
input 'BLF-36':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BBaseDaemon>
assign oiReturnStatus = -1.
return.
end.