project BLF > class Mail > method AddToMessage

Description

Add a part to a message


Parameters


icStringinputcharacterString that needs to be added to the mail message
imPartinputmemptrMemory pointer part that needs to be added to the message. If the size = 0, then the method automatically processes the string instead.
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


BLF
method Mail.ReadHandler


program code (program1/mail.p)

assign oiReturnStatus = -98.

IF GET-SIZE(imPart) = 0
THEN DO :
    IF icString = "" THEN RETURN.

    ASSIGN viExtentCount = viExtentCount + 1.

    set-size(vmMessage[viExtentCount]) = 0.
    SET-SIZE(vmMessage[viExtentCount]) = LENGTH(icString, "RAW":U) + 1.
    PUT-STRING(vmMessage[viExtentCount],1) = icString.
END.
ELSE ASSIGN viExtentCount = viExtentCount + 1
            vmMessage[viExtentCount] = imPart.

assign oiReturnStatus = 0.