Gracias ecfisa por responder
, y veras tengo un campo TEdit desde donde se están ingresando los valores de la variable "texto", pero al momento de ejecutar la función de GetTokenCount esta no reconoce el signo de % como un separador, si no lo toma como si estuviera toda la cadena en un solo valor.
Comparto parte del código en donde se hace esto:
Código Delphi
[-]procedure TFVenta.EdVentaKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
idesc, reng, icant, grs, I:integer;
scve, texto, import2, flag:string;
Desc, import, importotal, importdesc:real;
begin
if key = vk_RETURN then begin
if FVenta.Caption <> 'Devolucion de Productos' then begin
if Fventa.EdVenta.Text = '' then
begin
FVenta.EdGramos.SetFocus; end
Else
begin
texto:=FVenta.EdVenta.Text;
IF GetTokenCount(texto,'%') = 2 then begin
if (EsStrunNumero(GetToken(texto,'%',1))) and (EsStrunNumero(GetToken(texto,'%',2)))then begin
idesc:= StrToInt(GetToken(texto,'%',1)); scve:= GetToken(texto,'%',2);
if idesc <> 0 then begin
Desc:=1-idesc/100; import:=importdesc*Desc; Fventa.SGVenta.Cells[5,reng-1]:= IntToStr(idesc); end;
import2:=FormatFloat('#,##0.00',import); Fventa.SGVenta.Cells[6,reng-1]:= import2; end;
end;
end;
end;
end;
end;
que crees que pudiera ser que no me reconozca el signo como un separador, por que veo que en la prueba que realizaste si que lo reconoce como un separador.
Saludos.