Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Explicit
Private F As Integer
Private I As Long
Private Sub Form_Load()
On Error Resume Next
Kill "file.txt"
On Error GoTo 0
F = FreeFile(0)
Open "file.txt" For Output Lock Read Write As #F
Timer1.Interval = 100
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
I = I + 1
Print #F, I
If I >= 100 Then
Timer1.Enabled = False
Close #F
Unload Me
End If
End Sub
Option Explicit
Private Sub Form_Load()
Timer1.Interval = 500
Timer1.Enabled = True
End Sub
Private Sub Form_Resize()
If WindowState <> vbMinimized Then
'Text1 is a multiline TextBox:
Text1.Move 0, 0, ScaleWidth, ScaleHeight
End If
End Sub
Private Sub Timer1_Timer()
Dim F As Integer
Dim I As Long
F = FreeFile(0)
On Error Resume Next
Open "file.txt" For Input As #F
If Err Then
Text1.SelStart = &H7FFF
Text1.SelText = "Poll" & vbNewLine
Else
On Error GoTo 0
Timer1.Enabled = False
Do Until EOF(F)
Input #F, I
Text1.SelStart = &H7FFF
Text1.SelText = CStr(I) & vbNewLine
Loop
Close #F
Text1.SelStart = &H7FFF
Text1.SelText = "Complete"
End If
End Sub