how to export a long string into txt file?

icapilla
Member Posts: 30
Hi,
I'm trying to export a long string into txt file with a report. I declarated the following local variables :
Cadena1, text 1024
Cadena2, text 1024
Cadena3, text 1024
The section of code where i get the error is the following :
OutFile.WRITE(Cadena1+Cadena2+Cadena3);
When i execute the report, it gets the following error:
"there is not sufficient available space in the c/al stack memory to execute this task.
there are too many simultaneous activities,due to the way recursive function call is used in the program. the problem can by solved temporarily by shutting down some of the open activities(but the function still cannot be executed)."
thank you in advance for your suggestions.
I'm trying to export a long string into txt file with a report. I declarated the following local variables :
Cadena1, text 1024
Cadena2, text 1024
Cadena3, text 1024
The section of code where i get the error is the following :
OutFile.WRITE(Cadena1+Cadena2+Cadena3);
When i execute the report, it gets the following error:
"there is not sufficient available space in the c/al stack memory to execute this task.
there are too many simultaneous activities,due to the way recursive function call is used in the program. the problem can by solved temporarily by shutting down some of the open activities(but the function still cannot be executed)."
thank you in advance for your suggestions.
0
Answers
-
Look at the CREATEOUTSTREAM function in NAV. This is what you need.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
hi Alex Chow!
I´m a fellow of icapilla.
We have this code...
OutFile.CREATEOUTSTREAM(OStream);
OStream.WRITETEXT(Cadena1+Cadena2+Cadena3);
But the error continue...
If i only write this...
OutFile.CREATEOUTSTREAM(OStream);
OStream.WRITETEXT(Cadena1+Cadena2);
the file can be created but if write OStream.WRITETEXT(Cadena1+Cadena2+Cadena3) the error appears..
The total string is about 2500 characters
We need some help plz... ](*,)0 -
Of course you can not add all texts at the same time. This will exceed the limit of NAV string as well. Try this instead (adding by portions):
MyFile.CREATE('C:\Temp\dump.txt'); MyFile.CREATEOUTSTREAM(outstrm); YourCondition := ...; while (YourCondition) do begin TextPortion := 'text portion '; OutStrm.WRITETEXT(TextPortion); YourCondition := ...; end; MyFile.CLOSE;
0 -
Try this:
OutFile.CREATEOUTSTREAM(OStream);
OStream.WRITETEXT(Cadena1);
OStream.WRITETEXT(Cadena2);
OStream.WRITETEXT(Cadena3);
OutFile.CLOSE();
Chn0 -
Or you can write it in Binary mode char by char, in this mode you can write line as long as you want...0
-
Thanks for your suggestions, my problem it's solved,
i solved the problem with this sequence of code:OutFile.CREATEOUTSTREAM(OStream); REPEAT CR := 13; LF := 10; OStream.WRITETEXT(Cadena1); OStream.WRITETEXT(Cadena2); OStream.WRITETEXT(Cadena3); OStream.WRITETEXT(FORMAT(CR) + FORMAT(LF)); UNTIL VARIABLE.NEXT = 0;
0 -
please don't forget to mark it solved.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