Escolar Documentos
Profissional Documentos
Cultura Documentos
Toca um beep
function Pred(X);
Retorna o predecessor de um ordinal
uses Dialogs;
type
Colors = (RED,BLUE,GREEN);
var
S: string;
begin
S := 'The predecessor of 5 is ' + IntToStr(Pred(5)) + #13#10;
S := S + 'The successor of 10 is ' + IntToStr(Succ(10)) + #13#10;
if Succ(RED) = BLUE then
S := S + 'In the type Colors, RED is the predecessor of BLUE.';
MessageDlg(S, mtInformation, [mbOk], 0);
end;
procedure Randomize;
Inicializa o modo Randomico
var
I: Integer;
begin
Randomize;
for I := 1 to 50 do begin
{ Write to window at random locations }
Canvas.TextOut(Random(Width), Random(Height), 'Boo!');
end;
end;
function Succ(X);
Retorna o sucessor de um ordinal
uses Dialogs;
type
Colors = (RED,BLUE,GREEN);
var
S: string;
begin
S := 'The predecessor of 5 is ' + IntToStr(Pred(5)) + #13#10;
S := S + 'The successor of 10 is ' + IntToStr(Succ(10)) + #13#10;
if Succ(RED) = BLUE then
S := S + 'In the type Colors, RED is the predecessor of BLUE.';
MessageDlg(S, mtInformation, [mbOk], 0);
end;