How can i get the string exceeds the size 1024

Naidu.G
Member Posts: 31
Hi All,
i am using file variable and i try to write the string exceeds the size 1024 it show the
error like " The length of the text string exceeds the size of the string buffer." . How can i
get the string into file.
My Code is like :----
FTxt.CREATE('C:\mail.txt');
FTxt.OPEN('C:\mail.txt');
FTxt.WRITEMODE(TRUE);
FTxt.WRITE(autOLMItem."To");
FTxt.CLOSE;
Thanks & Regrads,
Naidu.
](*,)
i am using file variable and i try to write the string exceeds the size 1024 it show the
error like " The length of the text string exceeds the size of the string buffer." . How can i
get the string into file.
My Code is like :----
FTxt.CREATE('C:\mail.txt');
FTxt.OPEN('C:\mail.txt');
FTxt.WRITEMODE(TRUE);
FTxt.WRITE(autOLMItem."To");
FTxt.CLOSE;
Thanks & Regrads,
Naidu.
](*,)
0
Comments
-
In this case I am using simple trick - I am working with variable defined as Char with dimension e.g. 5000. In this case you can create functions to work with this array of chars as with long string and write it into file char by char.0
-
Hi kine,
i am using the following automations
Name DataType Subtype Length
autOLAppl Automation 'Microsoft Outlook 12.0 Object Library'.Application
autOLNamespace Automation 'Microsoft Outlook 12.0 Object Library'.NameSpace
autOLItems Automation 'Microsoft Outlook 12.0 Object Library'.Items
autOLMapiFolder Automation 'Microsoft Outlook 12.0 Object Library'.MAPIFolder
autOLMItem Automation 'Microsoft Outlook 12.0 Object Library'.MailItem
i wrote the code like this
Contact.RESET;
CLEAR(autOLAppl);
CREATE(autOLAppl);
autOLNamespace := autOLAppl.GetNamespace('MAPI');
autOLNamespace.Logon('','',TRUE,FALSE);
autOLMapiFolder := autOLNamespace.GetDefaultFolder(5);
autOLItems := autOLMapiFolder.Items;
i := 69;
intEndOfLoop := autOLItems.Count;
Total :=Contact.COUNT;
W.OPEN('Contact No..#1##################\\' + Text001);
WHILE i <= intEndOfLoop DO
BEGIN
X +=1;
W.UPDATE(1,Contact."No.");
W.UPDATE(2,X);
W.UPDATE(3,Total);
autOLMItem := autOLItems.Item(i);
Contact.RESET;
Rec."Synchronized Date" := autOLMItem.SentOn;
IF autOLMItem.Size > 9999 THEN BEGIN
MESSAGE('%1',autOLMItem.Size);
FTxt.CREATE('C:\mail.txt');
FTxt.OPEN('C:\mail.txt');
FTxt.WRITE(autOLMItem."To");
here i try to write the autOLMItem."To" into the file. But "To" string length is exceeds the 1024 so, it shows the error. Here how can i get char by char in to the character array.
For Example we are having the file or string then we will get the char by char but it is the
autOLMItem."To" ( automation dot property).
Thanks & Regrads,
Naidu. ](*,)0 -
Ok, your first example was only about writing into file... now you want to pass the string into automation. There is no way around... you need to pass string, but string in NAV is only 1024bytes. Or, yes, there is way around - another external DLL which will do what you need. My coworker created such a dll, it means it is possible (pass the string from nav into this external component, it will create one big text string, and pass it into the automation you will pass to this component... something like that. But you need to understand how to do DLLs for NAV.0
-
Hi,
Have you cosidered using BigText data type
See JReynolds example in the post
viewtopic.php?f=23&t=293130
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