Display \ character

abartonicekabartonicek Member Posts: 162
I searched and I couldn't find the solution so...

Is it possible to show a \ character in a message and NOT causing a new line?
Better to be critical then self-critical :)

Comments

  • krikikriki Member, Moderator Posts: 9,110
    Try:
    MESSAGE('This is a backslash:%1','\');
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • arindomarindom Member Posts: 52
    kriki is right
  • abartonicekabartonicek Member Posts: 162
    OK, this works :)
    But my reall problem is how to filter with \ character in the filter string :(

    IF I try:
    rec.SETFILTER(SomeField,'%1','Word1\Word2');
    MESSAGE(rec.GETFILTER(SomeField));
    
    then the resulting message is:
    Word1
    Word2
    Better to be critical then self-critical :)
  • arindomarindom Member Posts: 52
    IF I try:Code:
    rec.SETFILTER(SomeField,'%1','Word1\Word2');
    MESSAGE(rec.GETFILTER(SomeField));

    then the resulting message is:
    Word1
    Word2


    This right b'coz ' 'Word1\Word2' is charecter constant

    U have to write message as
    MESSAGE('%1', rec.GETFILTER(SomeField));


    Then try
  • bappaditya44bappaditya44 Member Posts: 14
    Use
    MESSAGE('%1',rec.GETFILTER(SomeField)); instead of
    MESSAGE(rec.GETFILTER(SomeField));
  • abartonicekabartonicek Member Posts: 162
    OK, thx.
    That MESSAGE(rec.GETFILTER(SomeField)); was just for testing...
    The real problem was setting filter with \ character.

    BTW, I used another filter (without \ character) that worked just as well.
    Better to be critical then self-critical :)
  • AntidotEAntidotE Member Posts: 61
    [SOLVED]
    Hello, I encountered such problem, but in a little another key...
    I need to show CONFIRM message, which contains filename with full path, e.g. 'Do you want to delete C:\folder\file.txt?'.
    If I use something like this
    IF CONFIRM(STRSUBSTNO(Text001,FileName)) THEN ...
    
    where
    Text001 TextConst 'Do you want to delete %1?'
    FileName Text250
    
    I get the following:
    Do you want to delete C:
    folder
    file.txt?

    I tried to use FORMAT(FileName), CONVERTSTR(FileName,'\',Character) where Character is Char and = '\'...
    The result is the same...

    Then I solved the problem by not using STRSUBSTNO in CONFIRM:
    IF CONFIRM(Text001,TRUE,FileName) THEN...
    
    It is hard to swim against self bloodstream... (c) Old, experienced kamikadze.
Sign In or Register to comment.