Show Pipe "|" in Message()

Using a standard Message box to display a help message. I am trying to show the | in the message to separate some options. Of course the | creates a cr/lf. I’ve tried chr(7ch) but Message was not fooled. Is there an Escape character for | that I can use?

Thanks.

Try
MESSAGE(‘user needs to do ‘& <124> &’ this to help’,‘ERROR!’,ICON:HAND,1)

AFAIK you cannot get the the Pipe in the Message(), the translation to <13,10> is in the RTL code.

One workaround is to use another similar character like ¦ CHR(124) <0A6h>. You can get that pressing ALT+0124 (on the number pad)

MESSAGE('¦ this is a pipe ¦ 166 ¦ A6h ¦'&|
        '|¦ this is a pipe ¦ 166 ¦ A6h ¦', 'Pipe Test', ICON:Thumbnail)


Another way is to make a Window(), then you can use any characters. I often have a Message() that gets too complicated and end up making a Window. You can have a Window in the DATA section of a ROUTINE, but then you have to code an Accept Loop. The easy way is to use a Window template.

In this Window Prompt it could use the actual Pipe | 7Ch

PipeMsg ROUTINE
   DATA
mPressed LONG
MsgWindow WINDOW('Pipe Test Window'),AT(,,115,59),CENTER,GRAY,FONT('Segoe UI',10)
 PROMPT('¦ this is a pipe ¦ 166 ¦ A6h ¦<0DH,0AH>¦ this is a pipe ¦ 166 ¦ A6h ¦'),AT(6,12,93,16),USE(?MainTextPrompt),TRN
 BUTTON('OK'),AT(5,40,50,14),USE(?mButton1)
 BUTTON('Cancel'),AT(60,40,50,14),USE(?mButton2),KEY(EscKey)
 END
    CODE
 OPEN(MsgWindow)
 ALERT(EscKey)      !Prevent ESC exit, uncomment to let it push Cancel using KEY(EscKey)
 SELECT(?mButton2)  !Cancel is default button
 ACCEPT 
   CASE EVENT()
     OF EVENT:CloseWindow 
   END !Event
   CASE ACCEPTED()
     OF ?mButton1 ; mPressed=? ; break   !OK
     OF ?mButton2 ; mPressed=? ; break   !Cancel
   END !Accepted
 END !ACCEPT()
 CLOSE(MsgWindow)

You could make your own MyMessageWithPipes Procedure that uses a WINDOW and a PROMPT or TEXT. Then write some code to adjust the height based on the PROP:LineCount of the TEXT.

1 Like

A window is the only real solution to the problem. But a substitute pipe works perfectly for this situation.

Thank you.