Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Schaltuhr in delphi (https://www.delphipraxis.net/6820-schaltuhr-delphi.html)

thorstenf01 23. Jul 2003 16:05


Schaltuhr in delphi
 
Hallo,
unten seht ihr das Programm einer Zeitschaltuhr, das in VB geschrieben
worden ist und funktioniert.
Wer kann mir dabei helfen, dieses in Delphi umzuwandeln...
Code:
Private Sub Form_Load()
  If OPENCOM("COM2:9600,N,8,1") = 0 Then MsgBox ("COM2 belegt")
  Timer1.Interval = 1000
  Timer1.Enabled = True
End Sub

Private Sub Form_Unload(Cancel As Integer)
  CLOSECOM
End Sub

Private Sub Timer1_Timer()
  Text1.Text = Time$
  If Time$ < Text1.Text Then DTR 0
  If (Time$ > Text2.Text) And (Time$ < Text3.Text) Then DTR 1
  If (Time$ > Text3.Text) And (Time$ < Text4.Text) Then DTR 0
  If (Time$ > Text4.Text) And (Time$ < Text5.Text) Then DTR 1
  If (Time$ > Text5.Text) Then DTR 0
End Sub
Danke im voraus
Gruß
Thorsten

Luckie 23. Jul 2003 16:09

Re: Schaltuhr in delphi
 
Kuck dir mal die TTimer-Komponente an und was die Hilfe dazu sagt. Dann solltest du das hinbekommen.


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:53 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz