Mike
I need your help again.
I do not have much practice in pascal code. I am developing the pascal code and is not working. Where is wrong? See code below.
Steve
var
iLenFind, count, iPos: integer;
sSource, stFind, stReplace, sFind, sReplace, sString, sOutput: string;
begin
sSource := Copy('[F001]', 25, 26);
stFind := 'ÁÀÃÂÉÊÈÍÌÓÔÕÒÚÙÇáàãâéêèíìóôõòúùç';
stReplace := 'AAAAEEEIIOOOOUUCaaaaeeeiioooouuc';
For count := 1 to 32 do
iLenFind := Length(sFind);
sString := sSource; sFind := Copy(stFind, count, 1); sReplace := Copy(stReplace, count, 1);
repeat
iPos := Pos(sFind, sString);
if iPos > 0 then
begin
sOutput := Copy(sString, 1, iPos - 1) + sReplace;
sOutput := sOutput + Copy(sString, iPos + Length(sFind), Length(sString) - iPos + Length(sFind));
sString := sOutput;
sSource := sString; end;
until iPos = 0;
Result := sString;
end;