Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   ayuda con TStringList (https://www.clubdelphi.com/foros/showthread.php?t=79595)

n03l 19-07-2012 23:27:20

ayuda con TStringList
 
saludos, queria ver si me pueden ayudar con un TStringList

estoy trabajando con un TStringList el cual tengo la nesecidad de insertar palabras en la misma linea pero al final

con un memo lo hago asi
Código Delphi [-]
Memo.SelText

pero no se como se hace con un TStringList

saludos y gracias de antemano...

Casimiro Noteví 19-07-2012 23:57:41

Por favor, recuerda poner títulos descriptivos a tus preguntas, gracias :)

ecfisa 20-07-2012 00:05:17

Hola n03l.

Cita:

estoy trabajando con un TStringList el cual tengo la nesecidad de insertar palabras en la misma linea pero al final
Código Delphi [-]
procedure AgregarAlFinal(stLst: TStrings; Linea: Integer; Cad: string);
begin
   if Linea in [0..stLst.Count-1] then
    stLst[linea]:= stLst[linea] + Cad;
end;

Ejemplo:
Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var
  TS: TStrings;
  i: Integer;
begin
  TS:= TStringList.Create;
  try
    for i:= 1 to 10 do TS.Add(IntToStr(i)+') '); // cargar unos valores...
    AgregarAlFinal(TS, 8, ' LINEA AGREGADA');  // Agregar al final de una línea determinada
    ListBox1.Items:= TS; // Mostrar en ListBox
  finally
    TS.Free;
  end;
end;


Saludos.

n03l 20-07-2012 15:41:43

Gracias me sirvio de mucho...


La franja horaria es GMT +2. Ahora son las 06:46:38.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi