Hello, I've been trying to export some fields through a dataport to a .TXT file.
On the OnBeforeExportRecord trigger of the Dataport I want to clean
my text fields from CR & LF characters that are attached to the end of the Code fields.
So I have tried all these:
c --> char = 13
1) "Dimension Value".Code:= DELCHR("Dimension Value".Code, '=', FORMAT(c));
2) Adding two Backspace [char=8] characters to the end of the "Dimension Value".Code
3) "Dimension Value".Code:=COPYSTR("Dimension Value".Code, 1, STRLEN("Dimension Value".Code)-2);
When I run the Dataport to export data in a .TXT file, the green processing bar gets stuck permanently and does not finally export the data.
Has anybody managed to export data cleaned from CRLF characters?
Any help would be highly appreciated.
* IF NOT done THEN REPEAT UNTIL done *
0
Answers
IF not, there may be another problems and you may require debugging.
Pargesoft
unfortunately, putting the altering DELCHR code in the OnAfterFormatField doesn't do the job, because it exports the data unchanged (with CRLF characters in it)
@ufuk:
Yes, that's what I was doing but it couldn't export the file.
************
Finally I solved it!
For a mysterious reason that I cannot understand,
I've put a VARIABLE instead of the field and IT WORKED!
So, I put:
variable_code:= DELCHR("Dimension Value".Code, '=', FORMAT(c));
and exported THE VARIABLE instead of the "Dimension Value".Code FIELD
If anyone has any idea why it works properly with a variable and not with the field
I'd be glad to know!
Thanx
Pargesoft
what you said was so correct and helpful!
Thank you very much