
Need Help With A Basic Program (ignore previous post) - Towercam.ba
I got Towercam.bas to decode. It was in QuickBasic 4.5 native code
format. I have included the towercam.bas source code to this message.
This bbs wont let me attach the source code so this is the best I can
do. if you dont see a REM ---END TOWERCAM.BAS--- at the end of the
source code, it did not all get through.
Tom
Rem ---BEGIN TOWERCAM.BAS---
CLS
phone$ = COMMAND$
OPEN "COM1:2400,N,8,1" FOR RANDOM AS #1 'open port
IF phone$ = "nul" OR phone$ = "NUL" THEN GOTO StartNul
PRINT " CKY TELEVISION - CAMERA CONTROL V1.0"
PRINT
PRINT " INLAND AUDIO VISUAL, JUNE 1992"
PRINT
PRINT " Dialing "; phone$; "..."
PRINT #1, "ATDT"; phone$ 'dial
GOSUB Feedback 'waits for proper connection
IF Response$ = "CONNECT 2400" THEN PRINT "Successful connection!" ELSE GOTO CrashCom
Response$ = ""
StartNul:
CLS
PRINT " CAMERA CONTROLS"
PRINT " ---------------"
PRINT
PRINT " UP = I"
PRINT
PRINT " LEFT = J RIGHT = L"
PRINT
PRINT " DOWN = K"
PRINT
PRINT
PRINT
PRINT
PRINT " ZOOM IRIS"
PRINT " ---- ----"
PRINT
PRINT " TELE = R OPEN = E"
PRINT " WIDE = F CLOSE = D"
PRINT
PRINT
PRINT " CURRENT MOVEMENT"
PRINT " ----------------"
start:
a$ = INPUT$(LOC(1), #1) 'clears input buffer
DO
IF NOT (EOF(1)) THEN
DO UNTIL EOF(1)
a$ = INPUT$(1, #1)
IF ASC(a$) >= 48 AND ASC(a$) <= 122 THEN GOTO CrashCom
LOOP
END IF
a$ = INKEY$
LOOP WHILE a$ = ""
a = ASC(a$)
SELECT CASE a
CASE IS = 73 OR 105 'up (I)
PRINT #1, CHR$(175) + CHR$(0) + CHR$(&HFF) + CHR$(0) + CHR$(&H80) + CHR$(0)
LOCATE 23
PRINT " Tilt Up "
CASE IS = 75 OR 107 'down (K)
PRINT #1, CHR$(175) + CHR$(0) + CHR$(&HFF) + CHR$(0) + CHR$(&H40) + CHR$(0)
LOCATE 23
PRINT " Tilt Down "
CASE IS = 74 OR 106 'left (J)
PRINT #1, CHR$(175) + CHR$(0) + CHR$(&HFF) + CHR$(0) + CHR$(&H20) + CHR$(0)
LOCATE 23
PRINT " Pan Left "
CASE IS = 76 OR 108 'right (L)
PRINT #1, CHR$(175) + CHR$(0) + CHR$(&HFF) + CHR$(0) + CHR$(&H10) + CHR$(0)
LOCATE 23
PRINT " Pan Right "
CASE IS = 82 OR 114 'Zoom Tele (R)
PRINT #1, CHR$(175) + CHR$(0) + CHR$(&HFF) + CHR$(0) + CHR$(&H8) + CHR$(0)
LOCATE 23
PRINT " Zoom Tele "
CASE IS = 70 OR 102 'zoom wide (F)
PRINT #1, CHR$(175) + CHR$(0) + CHR$(&HFF) + CHR$(0) + CHR$(&H4) + CHR$(0)
LOCATE 23
PRINT " Zoom Wide "
CASE IS = 69 OR 101 'iris open (E)
PRINT #1, CHR$(175) + CHR$(0) + CHR$(&HFF) + CHR$(0) + CHR$(&H2) + CHR$(0)
LOCATE 23
PRINT " Iris Open "
CASE IS = 68 OR 100 'iris close (d)
PRINT #1, CHR$(175) + CHR$(0) + CHR$(&HFF) + CHR$(0) + CHR$(&H1) + CHR$(0)
LOCATE 23
PRINT " Iris Close "
CASE IS = 81 OR 113 'quit (Q)
GOTO quit
CASE ELSE
GOTO start
END SELECT
DO WHILE INP(96) <> 0
LOOP
lp:
DO
LOOP WHILE INP(96) = 0
DO 'wait for release of key
LOOP WHILE INP(96) <> 0
IF INKEY$ <> "" THEN GOTO lp
PRINT #1, CHR$(175) + CHR$(0) + CHR$(&HFF) + CHR$(0) + CHR$(&H0) + CHR$(0)
LOCATE 23
PRINT " Idle "
GOTO start
quit:
IF phone$ = "nul" OR phone$ = "NUL" THEN END
PRINT "Hanging up..."
SLEEP 1
FOR i = 1 TO 3 'return modem to command state
PRINT #1, "+";
NEXT i
GOSUB Feedback
IF Response$ <> "OK" THEN GOTO CrashCom
SLEEP 1
PRINT #1, "ATH" 'hangup
GOSUB Feedback
IF Response$ <> "OK" THEN GOTO CrashCom
abort:
CLOSE #1
END
Feedback:
t = TIMER
DO
IF TIMER - t > 30 THEN GOTO CrashTime
a$ = INPUT$(1, #1)
LOOP UNTIL ASC(a$) >= 48 AND ASC(a$) <= 122
Response$ = ""
DO
Response$ = Response$ + a$
a$ = INPUT$(1, #1)
LOOP UNTIL a$ = CHR$(&HD)
RETURN
CrashCom:
PRINT Response$
PRINT "Communication error"
GOTO abort
CrashTime:
PRINT "Device Time-out error"
GOTO abort
GetData:
GOSUB Feedback
GOTO CrashCom
REM ---END TOWERCAM.BAS---