project BLF > class Mail > method FileToMemptr
Description
Convert a file to a memptr.
Parameters
icFile | input | character | Name of the file to be converted. |
ilEncode | input | logical | Should the memptr be encoded using base64 ? |
omFile | output | memptr | Memory pointer to the file content. |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
BLF
program code (program1/mail.p)
IF SEARCH(icFile) = ?
THEN DO :
<M-2 run SetMessage
(input #T-3'File not found: $1.':100(17)t-3# (icMessage),
input icFile (icArguments),
input '' (icFieldName),
input '' (icFieldValue),
input 'D':U (icType),
input 3 (iiSeverity),
input '' (icRowid),
input 'BLF-338':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in Mail>
ASSIGN oiReturnStatus = -3.
RETURN.
END.
copy-lob from file icFile to vmFile.
IF ilEncode
THEN do :
<M-1 run FileEncode (input vmFile (imIn),
input true (ilLineBreaks),
output omFile (omOut),
output viFcReturnSuper (oiReturnStatus)) in Mail>
if viFcReturnSuper <> 0
then oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0
then return.
end.
ELSE ASSIGN omFile = vmFile.
finally:
SET-SIZE(vmFile) = 0.
end finally.