web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

"Line-Continuation" Character?

(0) ShareShare
ReportReport
Posted on by 237

Hi

Editing an AL source code, is there any special character that can tell the editor that the line continues to the next line?

Like "_" (underscore) in Visual Basic?

Please advise.

Thank you!

I have the same question (0)
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    Just write the text on the new line. There's no a special chars to set.

  • adams1124 Profile Picture
    237 on at

    Thank you, Stefano.

    I actually would like to press Enter where I would like to. (CR and LF are inserted)

    This is to define a very long Label or to change a text variable with a very long value which do not fit into a screen on my PC monitor.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    In code you can press enter and write on the next line. On a label declaration you cannot do that.

  • Suggested answer
    YUN ZHU Profile Picture
    95,748 Super User 2025 Season 2 on at

    Hi, you just need to press enter.

    You can find many examples in the standard code.

    For example:

    pastedimage1632874204240v1.png

    Hope this will help.

    Thanks.

    ZHU

  • adams1124 Profile Picture
    237 on at

    Thank you, Stefano, for your advice.

  • adams1124 Profile Picture
    237 on at

    Thank you, Zhu.

    I learned that if it is like

        VariableA

             := 'value to be inserted';

    pressing Enter in the middle of the line works. But if it is like

        VariableB

             := 'This value is too long to fit into

                  the screen of my PC';

    pressing Enter in the middle of the line does not work and get an error.

    I was trying to find a solution for the 2nd case.

    How do you normally handle such cases?

  • Suggested answer
    YUN ZHU Profile Picture
    95,748 Super User 2025 Season 2 on at

    Hi, try this (\).

    pastedimage1632878763204v1.png

    pastedimage1632878771345v2.png

  • adams1124 Profile Picture
    237 on at

    Thank you again, Zhu.

    I may not have explained well enough what I was trying to do. It is not for BC users but it is only for myself when coding with VS Code.
    Typical example is when I need to define a variable type Label and the value of the label is very very long.

    *****

    MessageMsg: Label 'This is used for a message when the user tries to do xxxxxxxxxx, but the sequence of the operation is not correct. The user actually need to run yyyyyyyyyy first and then move on with zzzzzzzzzz .......... and so on ';
    *****
    In VS Code editor screen, the value does not continue automatically to the next line like above and I need to scroll horizontally to right and left to see the whole message. So I was wondering if I could do like
    *****
    MessageMsg: Label 'This is used for a message when the user tries to do xxxxxxxxxx, but the sequence of the operation is not correct.
                                       The user actually need to run yyyyyyyyyy first and then move on with zzzzzzzzzz .......... and so on ';
    *****
    I know with Visual Basic (the old language), I can do using '_' like
    *****
    MessageMsg: Label 'This is used for a message when the user tries to do xxxxxxxxxx, but the sequence of the operation is not correct. _
    The user actually need to run yyyyyyyyyy first and then move on with zzzzzzzzzz .......... and so on ';
    *****
    and wondered if I could do a similar thing with AL.
  • Verified answer
    YUN ZHU Profile Picture
    95,748 Super User 2025 Season 2 on at

    I'm sorry I didn't fully understand before.

    As far as I know, AL cannot use  '_to change lines like VB.

    If you do so, an error will be prompted. I believe you have tried.

    pastedimage1632882817764v1.png

    This may not look friendly, but it is also written on one line in the BC standard code.

    pastedimage1632882962995v2.png

    I'm sorry I can't solve your problem, but hope this will help.

    Thanks.
    ZHU

  • adams1124 Profile Picture
    237 on at

    Thank you, Zhu, for the clarification.

    I will then live with scrolling right and left :)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,092

#2
YUN ZHU Profile Picture

YUN ZHU 663 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 515

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans