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.
<job>
<reference object="Scripting.FileSystemObject"/>
<object id="FSO" progid="Scripting.FileSystemObject"/>
<script language="VBScript">
Option Explicit
Dim tsOut
'Create Unicode file.
Set tsOut = FSO.OpenTextFile("some-file.txt", ForWriting, _
True, TriStateTrue)
tsOut.WriteLine "Here's some Unicode text."
tsOut.Close
Set tsOut = Nothing
</script>
</job>
<job>
<reference object="CharGUI.Controller"/>
<object id="Con" progid="CharGUI.Controller"/>
<script language="VBScript">
Dim panBackdrop
Dim panStatus
Dim panText
Sub PaintBackdrop()
Set panBackdrop = _
Con.Panels.Add("Backdrop", 0, 0, 79, 24, bgDkBlack Or fgDkRed)
With panBackdrop
.Clear &HB0
.WriteXY " F1 Show Status " & Chr(&HB3) & _
" F2 Hide Status " & Chr(&HB3) & _
" F3 Enter Text " & Chr(&HB3) & _
" F12 EXIT SCRIPT ", _
bgLtCyan Or fgDkBlack, 6, 24
.Paint
End With
End Sub
Sub MakeStatus()
Set panStatus = _
Con.Panels.Add("Status", 0, 0, 33, 4, bgDkBlack Or fgLtCyan, _
btSingle, bgDkBlack Or fgLtCyan, "Status Board")
With panStatus
.WriteXY " ", bgLtGreen, 2, 1
.WriteXY "Lights", , 4, 1
.WriteXY " ", bgLtGreen, 12, 1
.WriteXY "Camera", , 14, 1
.WriteXY " ", bgLtGreen, 22, 1
.WriteXY "Action", , 24, 1
End With
End Sub
Sub PaintTextEntry()
Set panText = _
Con.Panels.Add("Text", 5, 7, 74, 19, bgLtBlack Or fgLtWhite, _
btDouble, bgDkRed Or fgLtYellow, "Text")
panText.Paint
End Sub
Sub HandleTextEntry()
Dim intKey
panBackdrop.Enabled = peNone
With panText
.Enabled = peBuffered
.Title = "Text Entry (ESC to exit)"
.Paint
Do
Do
WScript.Sleep 50
intKey = .InKey()
Loop Until intKey <> 0
If intKey = ASC_CR Then
.ReadLine 'Discard input for our purposes.
.WriteScroll , True
End If
Loop Until intKey = ASC_ESC
.Title = "Text"
.Paint
.Enabled = peNone
End With
panBackdrop.Enabled = peKeyInput
End Sub
Sub MainInputLoop()
Dim intKey
With panBackdrop
.Enabled = peKeyInput
Do
Do
WScript.Sleep 50
intKey = .InKey()
Loop Until intKey <> 0
Select Case intKey
Case -1 'F1.
panStatus.Paint
Case -2 'F2.
panStatus.Hide panBackdrop.Colors, &HB0
Case -3 'F3.
HandleTextEntry
'Else fall through.
End Select
Loop Until intKey = -12 'F12.
End With
End Sub
Con.Initialize , , "cgTest2"
PaintBackdrop
MakeStatus
PaintTextEntry
MainInputLoop
Set panText = Nothing
Set panStatus = Nothing
Set panBackdrop = Nothing
Con.Panels.DeleteAll
</script>
</job>