Ver Mensaje Individual
  #15  
Antiguo 02-05-2008
[egostar] egostar is offline
Registrado
 
Registrado: feb 2006
Posts: 6.572
Reputación: 27
egostar Va camino a la fama
A ver amigo [JoseFco], seguro que esto compila??????

Código Delphi [-]
procedure TForm1.BitBtn1Click(Sender: TObject);
var
  i,j,indice: integer;
  Str: String;
begin
  if OpenDialog1.Execute then begin
    Edit1.Text:=OpenDialog1.FileName;
    Edit2.Text:=('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>');
    Edit2.Text:=('Load File..................OK !');
    Memo1.Clear;
    //Inicializo las columnas y filas de el stringgrid donde se inicia la escritura
    with TStringList.Create do
      try
         if FileExists(Edit1.Text) then begin
            LoadFromFile(Edit1.Text);
            FillChar(Buffer,Sizeof(Buffer),#255);
            for i:= 0 to Count - 1 do
                Insertar(Strings[i],Buffer);
            j:= StrToInt(Label2.caption);
            Str:= EmptyStr;
         end;
      //***************************************************************
         begin
           indice := 0; //Suponiendo que buffer sea un array de 1...x
           for i := 1 to 255 do begin  //2 renglones, cambialo a los renglones que esperas
               for j := 1 to 16 do begin //15 columnas
                   stringgrid1.Cells[j,i] := inttohex(Buffer[indice],2);
                   inc(indice);
               end;
           end;
         end; //Este bloque que onda, porque entre un begin....end;
      //***************************************************************
         Str:= Str + #32 + IntToHex(Buffer[i],2);
         if ((i+1) mod 16 = 0) then begin
             Memo1.Lines.Add(Str);
             Str:= EmptyStr;
         end;
         if Str <> EmptyStr then
            Memo1.Lines.Add(Str);
      finally
         Free;
      end;
  end;
end; //Falta un end;

Salud OS
__________________
"La forma de empezar es dejar de hablar y empezar a hacerlo." - Walt Disney
Responder Con Cita