Hello,
I am trying to format text from a button. For instance when you press the button a long text string populates to the multi-line edit field that populates the obsterm.
I would like the text to have hard returns
aaaaa
bbbbbb
ccccccc
It currently comes out aaaaabbbbbbccccccc.
Does anyone know how to format this?
Thanks in Advance.
If you are using the action button in the set values, then try the formatting of /r/n
for eample: aaaaa/r/nbbbb/r/nccccc
those will create the hard returns you want. Your other option, depending on your coding is using. The HRET for a hard return, this works in codes with quotes
example: "aaaa" + HRET + "bbbb". Etc
make sense?
amy roberts
Correction: the correct control characters are "\r\n" versus "/r/n". (sorry Amy for correcting your post)
I have found that using the HRET much easier to type and then read at a later date.
I have tried both of these, neither are working. I should clarify, I am looking to format the text of the multiline edit field and the text translation.
Thank You.
So, not fixed text, but random text typed in by a user? You want that to be printed and stored with embedded 'hard' carriage returns?
So, if your input screen is 40 characters wide, you want to make sure that no line of text is greater than 40 characters?
While I ponder this, imagining some solution requiring setting arrays, I feel I must caution against this. As someone who has worked with data for years and years, embedded hard control characters can cause rippling problems.
~Joe
I don't know if this is the most effecient way to get this to work but it does works by:
Adding an action button with a runprocess type:
{fnAddPEFULL(OBSNOW("PE COMMENTS"),
"A
B
C")}
MEL CODE SIDE:
{! fn fnAddPEFULL(strVar,strTxt)
{local retStr = ""
local strBullet = ""
retStr = strVar
if strVar "" then
retStr = retStr + HRET + strBullet + strTxt
else
retStr = strBullet + strTxt
endif
OBSNOW("PE COMMENTS",retStr)
return ""
}}