Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #14  
Antiguo 02-03-2008
JoseFco JoseFco is offline
Baneado
 
Registrado: dic 2007
Posts: 1.861
Poder: 0
JoseFco cantidad desconocida en este momento
Código Delphi [-]
unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;
type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Label1: TLabel;
    OpenDialog1: TOpenDialog;
    Label2: TLabel;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  Form1: TForm1;
implementation
{$R *.dfm}
 function HextoInt(HexStr: String):integer;
const Hex : array['A'..'F'] of integer = (10,11,12,13,14,15);
var
    i   : integer;
begin
  Result:=0;
  for i := 1 to Length(HexStr) do
    if HexStr[i] < 'A' then Result := Result * 16 + Ord(HexStr[i]) - 48
                       else Result := Result * 16 + Hex[HexStr[i]];
end;
Function IntelHexFinalFileSize(const FileName: String): Integer;
var
 S: TStrings;
 n, FinalSize: Integer;
begin
 FinalSize:=0;
 S:=TStringList.Create;
 S.LoadFromFile(FileName);
 For n:=0 to S.Count-1 do Inc(FinalSize, HexToInt(Copy(S[n],2,2)));
 S.Free;
 Result:=FinalSize;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
  begin
  Label1.Caption:=OpenDialog1.FileName;
  Memo1.Lines.LoadFromFile(Label1.Caption);
  Label2.Caption:=IntToStr(IntelHexFinalFileSize(Label1.Caption));
end;
end;
end.

Gracias al amigo ixMike asunto resuelto.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Fichero Ini nelem Varios 2 03-01-2008 16:05:40
Tamaño de los ejecutables de Lazarus JULIPO Lazarus, FreePascal, Kylix, etc. 15 07-11-2007 17:41:36
Tamaño de mi ejecutable Ricardo Alfredo Varios 13 07-02-2007 20:47:14
recorrer listbox para modificar tamaño del form DM2005 Varios 1 15-08-2006 14:11:10
Obtener un fichero adjunto a un nodo de un fichero XML muntasil Internet 0 18-07-2006 12:57:57


La franja horaria es GMT +2. Ahora son las 15:56:08.


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
Copyright 1996-2007 Club Delphi