New Line Char

mickuk
Member Posts: 47
Hi all,
Im just building a section of code that generates a file that is read by another system, however im not sure quite how the syntax of the write statement works. Im used VB where you can specify and end of line char (charrige return) so that when you write a line to a file it moves down to the next.
As you can see its nothing complex that im trying to do but i find this development environment a nightmare!! What im looking for is to insert a end of line character after "testtext". Any help would be appreciated as the C/AL reference lib is VERY clear :P
Cheers in advance
Mick
Im just building a section of code that generates a file that is read by another system, however im not sure quite how the syntax of the write statement works. Im used VB where you can specify and end of line char (charrige return) so that when you write a line to a file it moves down to the next.
SiteFile.WRITE(item."groupname" + 'testtext');
As you can see its nothing complex that im trying to do but i find this development environment a nightmare!! What im looking for is to insert a end of line character after "testtext". Any help would be appreciated as the C/AL reference lib is VERY clear :P
Cheers in advance
Mick
0
Comments
-
Hi,
try SiteFile.TEXTMODE(TRUE) before you open SiteFile.
this should do charrige return and new line.
Read the C/SSIDE Reference Guide (=Online Help) for:
OPEN, WRITE and TEXTMODE
br
Josef Metzbr
Josef Metz0 -
Thanks for your response, i'm investigating what you suggested at the moment. Guess i just need to read the C/AL ref more and more, been through it a few times already #-o0
-
I usually create a function that returns an ASCII 13 followed by an ASCII 10. I typically call the function "CrLf", call the return value "Result" of type Text2. It contains the following code:
Result[1] := 13; Result[2] := 10;
The function can then be used to do the following:MyFile.WRITE('Foo' + CrLf + 'Baz');
Kind regards,
Jan Hoek
Product Developer
Mprise Products B.V.0 -
Thanks again for the information, you have been very helpful. The text mode function worked a treat....I can see where you are coming from though jhoek i didn't really thing about using a char variable and setting it to the carrige return char.
Good to know for future reference though. Fridays and mondays are never good to dive into a problem when you know your going to get distuirbed :P
Mick0
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