Ver Mensaje Individual
  #1  
Antiguo 13-02-2008
mjjj mjjj is offline
Miembro
 
Registrado: mar 2007
Posts: 652
Reputación: 18
mjjj Va por buen camino
Recortar un String

Hola... tengo un pequeño problema

Tengo un Tstringgrid, en donde la columna 2, no quiero que sea mas larga que 50 caracteres. Tengo un codigo que va algo asi.

Código Delphi [-]
if (stringgrid1.Col = 2) then
if length(stringgrid1.Cells[2,stringgrid1.row]) <= 50 then
CharUpperBuff(@Key, 1) else
begin
str:=stringgrid1.Cells[2,stringgrid1.row];
delete(str,51,256);
stringgrid1.Cells[2,stringgrid1.row]:=str;
end;

Pero no funciona... cuando llego al caracter 51 me borra todo el texto

Como lo soluciono??

Gracias
Responder Con Cita