bimsimsala
New Member
aloa,
i can do a line break in a message box like this:
MESSAGE "Hello. This line ~nbreaks".
now what i did is importing message texts from a text file, stored them in a temp table inside an init proc of a sessions super-proc :
======== <code ========================================
INPUT STREAM in-stream FROM VALUE(FILE-INFO:FULL-PATHNAME) NO-CONVERT.
REPEAT:
IMPORT STREAM in-stream DELIMITER "|" str1 str2.
CREATE tt-msgs.
ASSIGN msg_id = INT(str1)
msg_text = replace(str2, "~"", "").
RELEASE tt-msgs.
END.
======== code> ========================================
an example of a line found in the file is:
48|"Do you really ~nwant to quit the application ?"
to get the messages out of the temp table i use this function
======== <code ========================================
RETURNS CHARACTER
( INPUT iMsgId AS INTEGER ) :
/*------------------------------------------------------------------------------
Purpose:
Notes:
------------------------------------------------------------------------------*/
IF NOT bHaveMessages THEN
RETURN "".
FIND FIRST tt-msgs NO-LOCK WHERE tt-msgs.msg_id = iMsgId NO-ERROR.
IF AVAIL tt-msgs THEN
RETURN tt-msgs.msg_text.
ELSE
RETURN "".
END FUNCTION.
======== code> ========================================
the function call looks like this.
MESSAGE DYNAMIC-FUNC('getTextItem', INPUT 48).
but the result is a text box without a the broken line, but with the ~n printed as text.
any suggestions ??
i can do a line break in a message box like this:
MESSAGE "Hello. This line ~nbreaks".
now what i did is importing message texts from a text file, stored them in a temp table inside an init proc of a sessions super-proc :
======== <code ========================================
INPUT STREAM in-stream FROM VALUE(FILE-INFO:FULL-PATHNAME) NO-CONVERT.
REPEAT:
IMPORT STREAM in-stream DELIMITER "|" str1 str2.
CREATE tt-msgs.
ASSIGN msg_id = INT(str1)
msg_text = replace(str2, "~"", "").
RELEASE tt-msgs.
END.
======== code> ========================================
an example of a line found in the file is:
48|"Do you really ~nwant to quit the application ?"
to get the messages out of the temp table i use this function
======== <code ========================================
RETURNS CHARACTER
( INPUT iMsgId AS INTEGER ) :
/*------------------------------------------------------------------------------
Purpose:
Notes:
------------------------------------------------------------------------------*/
IF NOT bHaveMessages THEN
RETURN "".
FIND FIRST tt-msgs NO-LOCK WHERE tt-msgs.msg_id = iMsgId NO-ERROR.
IF AVAIL tt-msgs THEN
RETURN tt-msgs.msg_text.
ELSE
RETURN "".
END FUNCTION.
======== code> ========================================
the function call looks like this.
MESSAGE DYNAMIC-FUNC('getTextItem', INPUT 48).
but the result is a text box without a the broken line, but with the ~n printed as text.
any suggestions ??