Insert new line for a string in C/AL Code

SINOEUNSTEVENNEANG
SINOEUNSTEVENNEANG Member Posts: 202
Dear
Could you please tell now to insert new for string

A := "Welcome"
B :="Cambodia"

how can i make C become 2 lines ?
C := A + B

waiting for your kindly reply.

Comments

  • mohana_cse06
    mohana_cse06 Member Posts: 5,506
    Can you be more clear?
    What do you mean by 2 lines?
  • einsTeIn.NET
    einsTeIn.NET Member Posts: 1,050
    edited 2012-01-20
    Edit: double post
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • einsTeIn.NET
    einsTeIn.NET Member Posts: 1,050
    A := 'Welcome';
    B := 'Cambodia';
    C := A + '\' + B;
    
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • SINOEUNSTEVENNEANG
    SINOEUNSTEVENNEANG Member Posts: 202
    A := 'Welcome';
    B := 'Cambodia';
    C := A + '\' + B;
    

    it work fine with classic report but in RTC report it display "Welcome \Cambodia"
  • einsTeIn.NET
    einsTeIn.NET Member Posts: 1,050
    Did you try \n?
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • Savatage
    Savatage Member Posts: 7,142
    To me the post is confusing beacuse the first post shows
    A := "Welcome"
    B :="Cambodia"

    then you combine them

    c:= a+b
    then you want them seperated on two lines again.

    Is this for a report? The just put the two seperate field togther one under the other.
    :-k

    You mention RTC - so should this post be in forum: NAV Three Tier?
  • ericn
    ericn Member Posts: 2
    edited 2016-03-30
    A good way to force a new line is to use the ascii character for LineFeed. Carrige ride might also be needed. This can be used in Text variables interted into reports.

    Define a text variable.
    variable[1] := 10; //Ascii for Linefeed
    TextString := 'Text' + variable + 'text on new line'
    
    Output:
    Text
    text on new line
  • devdrone
    devdrone Member Posts: 14
    Just giving a childish answer.

    If you want the string Welcome Cambodia instead of WelcomeCambodia, try giving a space before Cambodia like ' Cambodia'.
  • Duikmeester
    Duikmeester Member Posts: 309
    VarMessage := 'Welcome Cambodia';
    VarMessage[8] := 10;     //Replace the 8th character (Space) with a Linefeed
    MESSAGE(VarMessage);