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!

  • adams1124 Profile Picture
    237 on at
    RE: "Line-Continuation" Character?

    Thank you, Zhu, for the clarification.

    I will then live with scrolling right and left :)

  • Verified answer
    YUN ZHU Profile Picture
    82,610 Super User 2025 Season 1 on at
    RE: "Line-Continuation" Character?

    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
    RE: "Line-Continuation" Character?

    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.
  • Suggested answer
    YUN ZHU Profile Picture
    82,610 Super User 2025 Season 1 on at
    RE: "Line-Continuation" Character?

    Hi, try this (\).

    pastedimage1632878763204v1.png

    pastedimage1632878771345v2.png

  • adams1124 Profile Picture
    237 on at
    RE: "Line-Continuation" Character?

    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?

  • adams1124 Profile Picture
    237 on at
    RE: "Line-Continuation" Character?

    Thank you, Stefano, for your advice.

  • Suggested answer
    YUN ZHU Profile Picture
    82,610 Super User 2025 Season 1 on at
    RE: "Line-Continuation" Character?

    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

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: "Line-Continuation" Character?

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

  • adams1124 Profile Picture
    237 on at
    RE: "Line-Continuation" Character?

    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
    RE: "Line-Continuation" Character?

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

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

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

#1
YUN ZHU Profile Picture

YUN ZHU 311 Super User 2025 Season 1

#2
Mansi Soni Profile Picture

Mansi Soni 242

#3
Sagar_Dangar_MCP Profile Picture

Sagar_Dangar_MCP 186

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans