Bueno asi esta la cosa:
Código Delphi
[-]
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, StdCtrls;
type
TForm1 = class(TForm)
StringGrid1: TStringGrid;
Label1: TLabel;
Button1: TButton;
UpAddr: TButton;
DownAddr: TButton;
procedure InicializaGridBuffer;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure UpAddrClick(Sender: TObject);
procedure DownAddrClick(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.InicializaGridBuffer;
var
i,j: integer;
begin
StringGrid1.ColWidths[0] := 35;
StringGrid1.Cells[0,0] := 'Addr';
j := $0000;
for i := 0 to 15 do
if i = 0 then
begin
StringGrid1.Cells[i+1,0] := IntTohex(i,2);
StringGrid1.Cells[0,i+1] := IntToHex(i,4);
end
else
begin
j := j + 16;
StringGrid1.Cells[i+1,0] := IntTohex(i,2);
StringGrid1.Cells[0,i+1] := IntToHex(j,4);
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
InicializaGridBuffer;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
aCol, aRow : Integer;
Cad : String;
begin
Cad := Label1.Caption;
aRow := StrToInt('$'+Cad[3])+1;
aCol := StrToInt('$'+Cad[4])+1;
StringGrid1.Col := aCol;
StringGrid1.Row := aRow;
end;
procedure TForm1.UpAddrClick(Sender: TObject);
begin
Label1.Caption := inttohex(strtoint('$'+Label1.Caption)+1,4);
end;
procedure TForm1.DownAddrClick(Sender: TObject);
begin
Label1.Caption := inttohex(strtoint('$'+Label1.Caption)-1,4);
end;
end.
Eso quedo como queria.
Los botones Up and Down son solo para que el programita ruede y poder probarlo.(la idea futura es que el solo camine)
Tengo un problemita y creo que es del codigo al crear el grid.Cuando el addr llega a la FF se retorna al 00 si es que pongo 01FF en el Label.Cuando creo el grid solo llego a la "FF".
Gracias Caro, muy buena tu ayuda.
Un Saludo.
PD:¿Que estoy tratando de hacer? No tengo idea pero algo saldra de todo esto.
