some time ago viewtopic.php?t=4139&postdays=0&postord ... m&start=20 I saw that, in my opinion, there was an error in Function FullTrim of StringUtils1 as the function some times truncated the last good letter in a word.
NOw, writing the update of the 35mm.it script I falled in the same error and I constructed a function a little bit different from your 'fulltrim' (see 'here is the difference' in the script).
Here you are an example:
Code: Select all
(***************************************************
Ant Movie Catalog importation script
www.antp.be/software/moviecatalog/
[Infos]
Authors=Fulvio53s03
Title=try Full Trim
Description=
Site=
Language=?
Version=1.0
Requires=3.5
Comments=
License=GPL
GetInfo=0
[Options]
***************************************************)
program TryFullTrim;
uses
StringUtils1;
var
TempField, MytrimField, FulltrimField: string;
ResultPath: string;
function MyTrim(Value: string):string;
var
ExitLoop: Boolean;
begin
Result := '';
ExitLoop := False;
repeat
case copy(Value, 1, 1) of
' ', #9, #10, #13: Value := copy(Value, 2, Length(Value)-1);
else
ExitLoop := True;
end;
until ExitLoop;
ExitLoop := False;
repeat
case copy(Value, Length(Value), 1) of
' ', #9, #10, #13: Value := copy(Value, 1, Length(Value)-1); // here is the difference
else
ExitLoop := True;
end;
until ExitLoop;
Result := Value;
end;
begin
tempfield := #9 + ' ' + #9 + ' ' +#9 + ' ' + 'America' + #9 + ' ' +#9;
MytrimField := MyTrim(TempField);
FulltrimField := FullTrim(TempField);
Showmessage ('***' + MytrimField + '***' + FulltrimField + '***');
end.
Thanks in advance
