Problem with the limit of a text variable

AitorEG
Member Posts: 342
Hi everyone,
I have a small problem with a text variable in NAV. This text variable, is writen in a file with the "WRITE" method, and must be everyhing in the same line. The issue, is that this line has 1047 positions, and the text data type only allows 1024 positions.
The problem is that the "WRITE" function, inserts automatically the line break, so I can't divide the data into 2 text variables, and write them separately.
How would you solve this issue? Is there any way to not insert the line break when writing? Or, can I usea any other data typo to generate the line?
Thank you very much
I have a small problem with a text variable in NAV. This text variable, is writen in a file with the "WRITE" method, and must be everyhing in the same line. The issue, is that this line has 1047 positions, and the text data type only allows 1024 positions.
The problem is that the "WRITE" function, inserts automatically the line break, so I can't divide the data into 2 text variables, and write them separately.
How would you solve this issue? Is there any way to not insert the line break when writing? Or, can I usea any other data typo to generate the line?
Thank you very much
0
Answers
-
Put your text into BigText variable type, adding chunk by chunk using ADDTEXT, and then stream out the big variable into a file.
This method has an opposite problem - it does not write any new lines. If you need some then you need to add new lines explicitely by appending a short text consisting of 0x0d and 0x0a characters in places where you want your linebreak.
Slawek
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
On a second thought - you have posted your quesion in NAV Three Tier - NAV 2013+ does not have a limit on Text variable lenght, just leave the lenght on your text variable definition blank
SlawekSlawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
Also, check out the OutStream data type. It does not add a line break on each write. Use an OutStream.WRITETEXT call without a parameter to actually write a line break. This way you likely don't even have to construct your line in a Text variable in the first place.0
-
https://msdn.microsoft.com/en-us/library/dd338712.aspx
Big Text Data Type
Microsoft
The maximum length of a Big Text variable is 2,147,483,647 characters and this corresponds to 2 GB.
I hope it will help you in this scenario.0 -
Thanks for the anserws, I will work on it!!0
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