Ver Mensaje Individual
  #7  
Antiguo 08-04-2007
CrazySoft CrazySoft is offline
Miembro
 
Registrado: abr 2005
Posts: 96
Reputación: 20
CrazySoft Va por buen camino
Cuando se tiene que optener un resultado de tipo string y se tiene el combobox ordenado, se debe relacionar el combobox con el StringList para recuperar los datos de lista


Código Delphi [-]
//Cargado de datos al combo y a list
var
   Lista := TStrings;
   Aux:String;
   i:Integer;
begin
    Lista := TStringList.Create;
    i:=0;
    with table1 do
    while not eof do
    begin
    Lista.Add(fieldByName('city').asString);
    combo.items.addObject(fieldByName('company').asString,
                                 Pointer(i));
             inc(i);
             next;
    end;
end;
// recuperacion de los datos
 
aux := Lista[Integer(combo.items.objects[combo.ItemIndex]];

Gracias

Última edición por CrazySoft fecha: 08-04-2007 a las 01:06:59.
Responder Con Cita