spaces within string (COMPRESSARRAY)

johnsogj
Member Posts: 103
I cant seem to get spaces to stick in the 5th line of my array. The SellToAddr variable is of type "text". How can I get spaces in between the pieces of the 5th line?
SellToAddr[1] := "Sell-to Customer Name";
SellToAddr[2] := "Sell-to Customer Name 2";
SellToAddr[3] := "Sell-to Address";
SellToAddr[4] := "Sell-to Address 2";
SellToAddr[5] := "Sell-to City" + "Sell-to County" + "Sell-to Post Code";
SellToAddr[6] := "Sell-to Country/Region Code";
COMPRESSARRAY(SellToAddr);
thanks
SellToAddr[1] := "Sell-to Customer Name";
SellToAddr[2] := "Sell-to Customer Name 2";
SellToAddr[3] := "Sell-to Address";
SellToAddr[4] := "Sell-to Address 2";
SellToAddr[5] := "Sell-to City" + "Sell-to County" + "Sell-to Post Code";
SellToAddr[6] := "Sell-to Country/Region Code";
COMPRESSARRAY(SellToAddr);
thanks
0
Comments
-
Do you mean this?
SellToAddr[5] := "Sell-to City" + ' ' + "Sell-to County" + ' ' + "Sell-to Post Code";
Compressarray has another functionality: it will "compress" all array elements in a way, that if the element is empty, all elements behind it will be shifted to the beginning. It means:
if you have this array:Array[1] := 'text1'; Array[2] := ''; Array[3] := 'text3'; Array[4] := ''; Array[5] := 'text5';
after you do COMPRESSARRAY the reult will be:Array[1] := 'text1'; Array[2] := 'text3'; Array[3] := 'text5'; Array[4] := ''; Array[5] := '';
0 -
Also take a look at FormatAddress Codeunit it already does formating of addresses for orders customers, etc etc.0
-
Do you mean this?
SellToAddr[5] := "Sell-to City" + ' ' + "Sell-to County" + ' ' + "Sell-to Post Code";
Compressarray has another functionality: it will "compress" all array elements in a way, that if the element is empty, all elements behind it will be shifted to the beginning. It means:
if you have this array:Array[1] := 'text1'; Array[2] := ''; Array[3] := 'text3'; Array[4] := ''; Array[5] := 'text5';
after you do COMPRESSARRAY the reult will be:Array[1] := 'text1'; Array[2] := 'text3'; Array[3] := 'text5'; Array[4] := ''; Array[5] := '';
Hello Kine,I want to Print Item."Vendor No." in a Report,with using of COMPRESSARRAY function.I mean i want to remove all lines having blank Vendor no..Any Idea?0 -
Hi SuD,
Please don't hijack old, only remotely related threads.
You probably need to useIF Item."Vendor No." = '' THEN CurrReport.SKIP;
in the OnAfterGetRecord of your Item DataItem.
COMPRESSARRAY is not suitable for your purpose.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