Dotnet class to remove a tab character
jwilder
Member Posts: 263
I can remove tab characters with normal NAV code by searching each character in a string. But I was thinking there might be a dotnet class to make this easier and faster. Can anyone point me in the right direction?
Jason Wilder
jwilder@stonewallkitchen.com
jwilder@stonewallkitchen.com
0
Answers
-
With Which:
Which := 'X'; Which[1] := 9;
This should be fast enoughNewString := DELCHR(String[, Where][, Which])
No need for dotnet in this case.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!1 -
This snip of code uses DotNet to strip null characters - should be easy enough to change. It also has file handling, which may not be applicable.
StripNulls(PassedFile : Text)
IF NOT FSOFile.Exists(PassedFile) THEN
ERROR(Text002, PassedFile);
Null := 0;
Space := 32;
StreamReader := FSOFile.OpenRead(PassedFile);
StringArray := FSOFile.ReadAllLines(PassedFile);
StreamReader.Close();
FOR X := 0 TO StringArray.Length() - 1 DO BEGIN
DotNetString := StringArray.GetValue(X);
DotNetString := DotNetString.Replace(Null, Space);
StringArray.SetValue(DotNetString, X);
END;
FSOFile.WriteAllLines(PassedFile, StringArray);
StreamReader.Close();
StreamReader.Dispose();
CLEAR(FSOFile);
CLEAR(StringArray);
Variables
Name DataType Subtype Length
FSOFile DotNet System.IO.File.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
DotNetString DotNet System.String.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
StringArray DotNet System.Array.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
StreamReader DotNet System.IO.StreamReader.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Null Char
Space Char
X IntegerKyle Hardin - ArcherPoint0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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