domingo, 27 de marzo de 2016
cambio horario saber dia de la semana saber numero del mes
uses DateUtils;
(...)
//******************************************
procedure TForm1.Button1Click(Sender: TObject);
var
diadelasemana: integer;
numerodemes: integer;
begin
diadelasemana:=DayOfWeek(now);
numerodemes:=MonthOfTheYear(now);
if ((diadelasemana=1)) then
begin
ShowMessage('domingo: ' + inttostr(numerodemes));
end;
end;
.
martes, 15 de marzo de 2016
maximo valor de int maximo entero
var
min, max : integer;
begin
// Set the minimum and maximum values of this data type
min := Low(integer);
max := High(integer);
ShowMessage('Min integer value = '+IntToStr(min));
ShowMessage('Max integer value = '+IntToStr(max));
end;
min, max : integer;
begin
// Set the minimum and maximum values of this data type
min := Low(integer);
max := High(integer);
ShowMessage('Min integer value = '+IntToStr(min));
ShowMessage('Max integer value = '+IntToStr(max));
end;
viernes, 11 de marzo de 2016
delphi tamaño de un fichero tamaño de un archivo
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
function tamanioA(nom:String):integer;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
//********************************************
function TForm1.tamanioA(nom:String):integer;
var
FHandle: integer;
begin
FHandle := FileOpen(nom, 0);
try
Result := (getfilesize(FHandle,nil));
finally
FileClose(FHandle);
end;
end;
//***********************************************
procedure TForm1.Button1Click(Sender: TObject);
var
aux: string;
i: integer;
begin
aux:='c:\sella5.pdf';
i:=((tamanioA(aux) div 1024) div 1024);
ShowMessage(aux + ' --> ' +inttostr(i) + ' Mb');
end;
end.
.
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
function tamanioA(nom:String):integer;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
//********************************************
function TForm1.tamanioA(nom:String):integer;
var
FHandle: integer;
begin
FHandle := FileOpen(nom, 0);
try
Result := (getfilesize(FHandle,nil));
finally
FileClose(FHandle);
end;
end;
//***********************************************
procedure TForm1.Button1Click(Sender: TObject);
var
aux: string;
i: integer;
begin
aux:='c:\sella5.pdf';
i:=((tamanioA(aux) div 1024) div 1024);
ShowMessage(aux + ' --> ' +inttostr(i) + ' Mb');
end;
end.
.
martes, 8 de marzo de 2016
showmessage salto de linea intros
ShowMessage('TU VIDA'+ #13#10 + 'SERA' + #13#10 +
'UNA CANCION');
.
'UNA CANCION');
.
Suscribirse a:
Entradas (Atom)