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?
FOR X := 0 TO StringArray.Length() - 1 DO BEGIN
DotNetString := StringArray.GetValue(X);
DotNetString := DotNetString.Replace(Null, Space);
StringArray.SetValue(DotNetString, X);
END;
Answers
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
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 Integer