unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Classes,
Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
Numero: Integer;
begin
Randomize;
Numero := Random(100); // número entre 0 e 99
Label1.Caption := 'Número gerado: ' + IntToStr(Numero);
end;
end.
==============================================================
https://www.nasciweb.com.br
Gerador de número aleatório em Delphi
-
HenryPyday
- Mensagens: 1
- Registado: quinta jan 16, 2025 12:01 pm