Ver Mensaje Individual
  #4  
Antiguo 27-06-2006
Avatar de Bicho
[Bicho] Bicho is offline
Miembro Premium
 
Registrado: jul 2003
Ubicación: Inca - Mallorca
Posts: 1.776
Reputación: 24
Bicho Va por buen camino
Ahora caigo que quizá no sepas cuantas bases hay en la sección del ini.

De esto modo puedes haceer lo siguiente:

Código Delphi [-]
procedure Form1.GetDatosIni;
var st : TStringList;
    aux, base : String;
begin
  MyIni := tIniFile.create('nombrearchivo.ini');

  with MyIni do begin
    st := tStringList.create; //tendremos un stringlist con el contenido de la seccion
    ReadSection('Bases,st');
    for r := 0 to st.count-1 do begin
      aux  := st.strings[r]; //guardamos el indice del dentro de la seccion para buscar su valor
      base := READstring('Bases,aux,''); //obtenemos el valor
      ListBox1.Items.Add(base); //lo metemos en un listbox
    end;
    st.Free;
    Free;
   end;
end;

Espero haberme explicado bien.

Saludos
Responder Con Cita