19. August 2014 15:02
19. August 2014 19:12
20. August 2014 07:30
SilverX hat geschrieben:Ich hab das WaldoNavPad seit Jahren nicht mehr in Aktion gesehen, aber es sollte unter Dynamics NAV 2013+ doch Unicode verwenden. Damit wäre eine Konvertierung überflüssig.
20. August 2014 07:39
20. August 2014 08:11
fiddi hat geschrieben:Hallo,
wir hatten das Thema hier gerade.
Der einzig gangbare Weg scheint im Moment über die Funktion aus der CU 11501 zu sein. Die funktioniert
Gruß, Fiddi
20. August 2014 08:45
20. August 2014 09:49
LOCAL ImportNotePadDocumentLines(parCommentLength : Integer)
FileNameLoc := MagicPath;
FOR i := STRLEN(MagicPath) DOWNTO 1 DO BEGIN
IF MagicPath[i] = '\' THEN BEGIN
MagicPath := COPYSTR(MagicPath,1,i);
Length := STRLEN(MagicPath);
i := 1;
END;
END;
FileNameLoc := COPYSTR(FileNameLoc,Length);
UPLOADINTOSTREAM('', MagicPath, '', FileNameLoc, TempStream);
loctxtComment := '';
locintCountLength := 0;
locintCommentLength := parCommentLength;
WHILE NOT TempStream.EOS DO BEGIN
locintNoteLength := TempStream.READTEXT(loctxtNotePad,1024);
loctxtNotePad := COPYSTR(StreamReader.ReadLine,1,locintNoteLength);
IF loctxtComment <> '' THEN BEGIN
IF COPYSTR(loctxtComment,STRLEN(loctxtComment),1) <> ' ' THEN
loctxtComment := loctxtComment + ' ';
loctxtNotePad := loctxtComment + loctxtNotePad;
locintNoteLength += STRLEN(loctxtComment);
loctxtComment := '';
locintCountLength := 0;
END;
locbooForceCR := intReturnNo <> 0;
IF locintNoteLength = 1024 THEN
locbooForceCR := FALSE;
locintCopyFrom := 1;
locintLastPos := 1;
IF (STRLEN(loctxtNotePad) + locintCountLength > locintCommentLength) THEN BEGIN
FOR i := 1 TO STRLEN(loctxtNotePad) DO BEGIN
locintCountLength += 1;
IF COPYSTR(loctxtNotePad,i,1) IN [' ',',','.','?','!',':',';'] THEN BEGIN
loctxtComment := loctxtComment + COPYSTR(loctxtNotePad,locintLastPos,i + 1 - locintLastPos);
locintLastPos := i + 1;
END;
IF locintCountLength = locintCommentLength THEN BEGIN
IF loctxtComment = '' THEN BEGIN
locintLastPos := i + 1;
loctxtComment := COPYSTR(loctxtNotePad,locintCopyFrom,locintLastPos - locintCopyFrom);
END;
locintCountLength := i - locintLastPos + 1;
loctxtComment := ANSI2ASCII(loctxtComment);
IF COPYSTR(loctxtComment,STRLEN(loctxtComment),1) = ' ' THEN
loctxtComment := COPYSTR(loctxtComment,1,STRLEN(loctxtComment) - 1);
WriteCommentDocumentLines(loctxtComment,FALSE);
locintCopyFrom := locintLastPos;
IF STRLEN(loctxtNotePad) - locintCopyFrom < locintCommentLength THEN BEGIN
loctxtComment := COPYSTR(loctxtNotePad,locintCopyFrom);
IF COPYSTR(loctxtComment,1,1) = ' ' THEN
loctxtComment := COPYSTR(loctxtComment,2);
locintCountLength := STRLEN(loctxtComment);
i := STRLEN(loctxtNotePad);
IF TempStream.EOS OR locbooForceCR THEN BEGIN
locintCountLength := 0;
loctxtComment := ANSI2ASCII(loctxtComment);
WriteCommentDocumentLines(loctxtComment,TRUE);
END;
END;
END;
END;
END ELSE BEGIN
loctxtComment := loctxtNotePad;
loctxtComment := ANSI2ASCII(loctxtComment);
WriteCommentDocumentLines(loctxtComment,locbooForceCR);
END;
END;
LOCAL ImportNotePadDocumentLines(parCommentLength : Integer)
FileNameLoc := MagicPath;
FOR i := STRLEN(MagicPath) DOWNTO 1 DO BEGIN
IF MagicPath[i] = '\' THEN BEGIN
MagicPath := COPYSTR(MagicPath,1,i);
Length := STRLEN(MagicPath);
i := 1;
END;
END;
FileNameLoc := COPYSTR(FileNameLoc,Length);
UPLOADINTOSTREAM('', MagicPath, '', FileNameLoc, TempStream);
StreamReader := StreamReader.StreamReader(TempStream,Encoding.Default);
loctxtComment := '';
locintCountLength := 0;
locintCommentLength := parCommentLength;
WHILE NOT StreamReader.EndOfStream DO BEGIN
locintNoteLength := STRLEN(StreamReader.ReadLine);
// loctxtNotePad := COPYSTR(StreamReader.ReadLine,1,locintNoteLength);
IF loctxtComment <> '' THEN BEGIN
IF COPYSTR(loctxtComment,STRLEN(loctxtComment),1) <> ' ' THEN
loctxtComment := loctxtComment + ' ';
loctxtNotePad := loctxtComment + loctxtNotePad;
locintNoteLength += STRLEN(loctxtComment);
loctxtComment := '';
locintCountLength := 0;
END;
locbooForceCR := intReturnNo <> 0;
IF locintNoteLength = 1024 THEN
locbooForceCR := FALSE;
locintCopyFrom := 1;
locintLastPos := 1;
IF (STRLEN(loctxtNotePad) + locintCountLength > locintCommentLength) THEN BEGIN
FOR i := 1 TO STRLEN(loctxtNotePad) DO BEGIN
locintCountLength += 1;
IF COPYSTR(loctxtNotePad,i,1) IN [' ',',','.','?','!',':',';'] THEN BEGIN
loctxtComment := loctxtComment + COPYSTR(loctxtNotePad,locintLastPos,i + 1 - locintLastPos);
locintLastPos := i + 1;
END;
IF locintCountLength = locintCommentLength THEN BEGIN
IF loctxtComment = '' THEN BEGIN
locintLastPos := i + 1;
loctxtComment := COPYSTR(loctxtNotePad,locintCopyFrom,locintLastPos - locintCopyFrom);
END;
locintCountLength := i - locintLastPos + 1;
loctxtComment := ANSI2ASCII(loctxtComment);
IF COPYSTR(loctxtComment,STRLEN(loctxtComment),1) = ' ' THEN
loctxtComment := COPYSTR(loctxtComment,1,STRLEN(loctxtComment) - 1);
WriteCommentDocumentLines(loctxtComment,FALSE);
locintCopyFrom := locintLastPos;
IF STRLEN(loctxtNotePad) - locintCopyFrom < locintCommentLength THEN BEGIN
loctxtComment := COPYSTR(loctxtNotePad,locintCopyFrom);
IF COPYSTR(loctxtComment,1,1) = ' ' THEN
loctxtComment := COPYSTR(loctxtComment,2);
locintCountLength := STRLEN(loctxtComment);
i := STRLEN(loctxtNotePad);
IF TempStream.EOS OR locbooForceCR THEN BEGIN
locintCountLength := 0;
loctxtComment := ANSI2ASCII(loctxtComment);
WriteCommentDocumentLines(loctxtComment,TRUE);
END;
END;
END;
END;
END ELSE BEGIN
loctxtComment := loctxtNotePad;
loctxtComment := StreamReader.ReadLine;
WriteCommentDocumentLines(loctxtComment,locbooForceCR);
END;
END;