New line in a string

philippegirod
Member Posts: 191
:roll: For a beginner in C/side (me)...
What is the expression to have a new line in a string, for instance if I want to have a message with 2 lines what is the syntax (I know it for other languages, like '\n')?
//example
text01 := 'first line..... second line';
MESSAGE(text01);
What is the expression to have a new line in a string, for instance if I want to have a message with 2 lines what is the syntax (I know it for other languages, like '\n')?
//example
text01 := 'first line..... second line';
MESSAGE(text01);
My candle burns by both ends, it will not last the night,
But oh my foes and oh my friends, it gives a lovely light
But oh my foes and oh my friends, it gives a lovely light
0
Comments
-
//example text01 := 'first line\second line'; // you need the backslash MESSAGE(text01);
HTH,
Daniel0 -
Thanks a lot for your answer, it is exactely what I wanted.
Is there a way to have a new line in a Tooltip on a form ?
The '\' doesn't work apparently.
Definitely, I'm a beginner.........My candle burns by both ends, it will not last the night,
But oh my foes and oh my friends, it gives a lovely light0 -
-
philippegirod wrote:[...]
Is there a way to have a new line in a Tooltip on a form ?
The '\' doesn't work apparently.
[...]
I think it is not possible to have a new line in a TooltipTimo Lässer
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]0 -
The '\' doesn't works inside a STRSUBSTNO,
For instance if I have this code :TextInReport := STRSUBSTNO('%1\%2',Rec.Field1,Rec.Field2);
The result is "Text of the field 1\Text of the field 2"
How to have a new in this case ?
Thanks again for all your help.My candle burns by both ends, it will not last the night,
But oh my foes and oh my friends, it gives a lovely light0 -
philippegirod wrote:The '\' doesn't works inside a STRSUBSTNO,
For instance if I have this code :TextInReport := STRSUBSTNO('%1\%2',Rec.Field1,Rec.Field2);
The result is "Text of the field 1\Text of the field 2"
How to have a new in this case ?
Thanks again for all your help.
Note: The control must be long enough to show one whole line. Otherwise the new line doesn't work. :roll:Timo Lässer
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]0 -
Yes, of course..... I knew those important things.
But the problem occurs only in a report.
I can have a text box in a form with several lines, in a message too but not in a report.
In the report, Navision print '\' instead of give a new line. I suppose there is an other syntax to have new line, but I don't know which.My candle burns by both ends, it will not last the night,
But oh my foes and oh my friends, it gives a lovely light0 -
Ignore this post!
I thought that I had the solution, but it didn't work.Now, let's see what we can see.
...
Everybody on-line.
...
Looking good!0 -
The only solution I could find is to have a text var with dimensions (as many as new line needed).
Then, when the condition to change the line is there I can use that kind of code :i := i+1; VarText[i] := STRSUBSTNO('%1 ',Table.Field);
Then, in the report I have a new Table body for each dimension possible and in the OnPreSection trigger I simply use this code (for instance) :IF VarText[3] = '' THEN CurrReport.SHOWOUTPUT(FALSE);
My candle burns by both ends, it will not last the night,
But oh my foes and oh my friends, it gives a lovely light0 -
You can find solution on www.Navision.Net website for this query. Please find Line Feed or Carraige Return in search window.Jaiswal Rajesh Kumar-1
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions