Leading and trailing spaces in dataport

dolec
Member Posts: 12
Hi,
In 2.60 I've written a dataport which reads a text into the text variables:
txtText1 1 250
txtText2 251 251
txtText3 502 251
The problem is that the dataport omits leading and trailing spaces in the text variables. So that if I write them back by command:
file.WRITE(FORMAT(txtText1,250)+FORMAT(txtText2,251)+txtText3);
The line is shorter and incorrect
Does anybody know how to avoid this problem?
Thanks
In 2.60 I've written a dataport which reads a text into the text variables:
txtText1 1 250
txtText2 251 251
txtText3 502 251
The problem is that the dataport omits leading and trailing spaces in the text variables. So that if I write them back by command:
file.WRITE(FORMAT(txtText1,250)+FORMAT(txtText2,251)+txtText3);
The line is shorter and incorrect

Does anybody know how to avoid this problem?
Thanks
0
Comments
-
Hi,
maybe you should format the last string also. In my mind the command you described should be the following:
file.WRITE(FORMAT(txtText1,250)+FORMAT(txtText2,251)+format(txtText3,251));
This should be corrert for the system.
It's better to use a separated file instead of fixed length text. I always do this.
[
quote="dolec"]Hi,
In 2.60 I've written a dataport which reads a text into the text variables:
txtText1 1 250
txtText2 251 251
txtText3 502 251
The problem is that the dataport omits leading and trailing spaces in the text variables. So that if I write them back by command:
file.WRITE(FORMAT(txtText1,250)+FORMAT(txtText2,251)+txtText3);
The line is shorter and incorrect
Does anybody know how to avoid this problem?
Thanks[/quote]Brg,
--
János Borsics0 -
Thank you borsicsj,
but this can't solve the problem. The spaces are omitted just after the text is written into txtText1,..2,..3.
For example (can be inconveniently formatted by your browser):
input text = " aaa bbb ccc ddd eee fff "
... in OnBeforeEvaluateField the variables have this values:
txtText1 = "aaa bbb"
txtText2 = "ccc ddd"
txtText3 = "eee fff"
... and I want to obtain this:
txtText1 = " aaaa bbb "
txtText2 = " ccc ddd "
txtText3 = " eee fff "
Thank you for your help0 -
uuh!! again:
Thank you borsicsj,
but this can't solve the problem. The spaces are omitted just after the text is written into txtText1,..2,..3.
For example (can be inconveniently formatted by your browser):input text = " aaa bbb ccc ddd eee fff " ... in OnBeforeEvaluateField the variables have this values: txtText1 = "aaa bbb" txtText2 = "ccc ddd" txtText3 = "eee fff" ... and I want to obtain this: txtText1 = " aaaa bbb " txtText2 = " ccc ddd " txtText3 = " eee fff "
Thank you for your help[/code]0 -
Hi Dolec,
only an idea, have you already thought about the following:
before import : replace all space by a special-character?
and
after import : replace this special-character by space.
best regards
Rolf HeinsohnRolf
- Only happy people can have success -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