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


icTargetFieldinputcharacterValue 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 tfcDaemon.DaemonLogFile
validation on tfcDaemon.DaemonStartDirectory
validation on tScanDaemonLocation.ScanDaemonLocationDir
validation on tXmlDaemon.XmlDaemonDirectory


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.