filler and filler character attribute:how does it work?

wic
Member Posts: 96
Yo,
I want to export data in a file but I've to format them specially. Example:
quantity must be 10 length and filled with 0 before (or after..same problem):
12 pces = 0000000012
location code: 10 length with <space> after
LOCA1 =>'LOCA1 '
:shock:
and so on. I thought I could use the FORMAT...FILLER attribute, but I can't get the expected result.
My code sample:
//how define left/right?
//why not filled with 0
Value := FORMAT(qty,10,'<FILLER CHARACTER,0>');
f.write(value);
thanx for all incoming ideas
I want to export data in a file but I've to format them specially. Example:
quantity must be 10 length and filled with 0 before (or after..same problem):
12 pces = 0000000012
location code: 10 length with <space> after
LOCA1 =>'LOCA1 '
:shock:
and so on. I thought I could use the FORMAT...FILLER attribute, but I can't get the expected result.
My code sample:
//how define left/right?
//why not filled with 0
Value := FORMAT(qty,10,'<FILLER CHARACTER,0>');
f.write(value);
thanx for all incoming ideas
#### Only one can survive ######
0
Answers
-
Try the PADSTR instead:
Before:
Value := PADSTR('',10 - STRLEN(FORMAT(Quantity)),0) + FORMAT(Quantity);
After:
Value := PADSTR("Location Code",10,' ');0 -
I have the similar problem can any one assist on this.Thanks & Regards
Brijesh Karnatak0 -
In my Case I am explaining a scenario.
tt is a variable of type OutStream.
TextFile is a Variable of type File
TextFile.CREATEOUTSTREAM(tt);
tt.WRITETEXT('H');
tt.WRITETEXT('-',8);
tt.WRITETEXT("Gen. Journal Line1"."Journal Batch Name",31);
I need H as first character and then 8 Blank Spaces, after that the Journal Batch name should start. So the Batch name should start from 10th position
and should end at 31st position. As the field length of Batch name is 10 so the remaining character should be filled with filler as blank.Thanks & Regards
Brijesh Karnatak0 -
Value := FORMAT(qty,10,'<FILLER CHARACTER,0>');
The correct form of formatstring is '<Integer,10><Filler Character,0>'. You have to give the datatype of expression, and its lenght. Important, it operates only the filler character after the expression datatype, as i experienced it.
So the correct form of the code:Value:=FORMAT(qty,10,'<Integer,10><Filler Character,0>');
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