Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
procedure TForm1.Memo1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if gedrueckt = False then // "gedrueckt" ist meine Boolean-Variable
begin
start := GetTickCount; // Die Windows-Laufzeit wird in meine Longint-Variable "start" eingelesen
gedrueckt := True; // "gedrueckt" wird auf "true" gesetzt, sonst würde start immer wieder neu eingelesen werden
end;
end;
procedure TForm1.Memo1KeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
gedrueckt := False; // gedrueckt wird zurueckgesetzt
ShowMessage(IntToStr(GetTickCount - start)); // Die gedrückte Zeit wird in Millisekunden angezeigt
end;
...nicht delphi!pape hat gesagt.:Ist es in Pascal möglich
sound(round(f));//f ist die berechnete fqz
repeat until not keypressed;
nosound;
unit thetimer;
interface
Uses
{crt,} DOS;
Var
OldInt8 : Procedure;
Milliseconds, gesamt: LongInt;
i : integer;
{Procedure NewInt8;}
Procedure SetNewInt8;
Procedure SetOldInt8;
procedure timed(interval:integer);
implementation
Procedure NewInt8; Interrupt;
Begin
Inline ($FA);{CLI}
Inc (Milliseconds);
Inc (gesamt);
IF ((Milliseconds mod 55{1000 / 18.2}) = 0) THEN
Begin
Inline ($9C / $FB);{PUSHF, STI}
OldInt8;
End
ELSE
Begin
Inline ($FB);{STI}
Port[$20] := $20; {Interrupt-end signal}
End;
End;
Procedure SetNewInt8;
Begin
GetIntVec ($08, @OldInt8);
SetIntVec ($08, @NewInt8);
ASM {Set Timer to 1000 Hz}
cli
mov dx, $43
mov al, $36
out dx, al
sub dx, 3
mov al, 169
out dx, al
mov al, 4
out dx, al
sti
End;
End;
Procedure SetOldInt8;
Begin
ASM {Reset Timer to 18.2 Hz}
cli
mov dx, $43
mov al, $36
out dx, al
sub dx, 3
xor ax, ax
out dx, al
out dx, al
sti
End;
SetIntVec ($08, @OldInt8);
End;
procedure timed(interval:integer);
begin
Milliseconds := 0;
repeat
until (Milliseconds = interval);
end;
Begin
{for i := 1 to 50 do begin
clrscr;
write(i); {testprogramm}
{timed(1000);
end;}
End.