I have some code that runs in a DOS window and need to know what language it is written in it may not be qbasic. I will then study that language so that I may modify it to do what I want. A sample of the language is shown below. It connects to a device on a com port and then asks questions the user responds to, eventually writing a CSV document to a file.
Thanks in advance to all who take the time to read and respond to this question.
'**** PROCEDURE ****
'
START:
OPEN "O", 3, "DRDUMP.DAT", 512 'Open output data file
Print FF$
Print Tab(28); "CPN TDRDUMP REV. 01/02/96": Print Tab(18); "UTILITY TO DOWNLOAD DATA FROM A 503TDR GAUGE"
Print Tab(15); "THIS VERSION RUNS ONLY WITH THE NEW 503 TANK BOARD": Print
PRINT "ENTER THE COM PORT USED 1"; STRING$(3, BKSP$); : INPUT CM$: IF CM$ = " " THEN CM$ = "1"
If CM$ <> "1" And CM$ <> "2" And CM$ <> "3" And CM$ <> "4" Then CM$ = "1"
Print "BAUDRATE, ENTER 1 FOR 300, 2 FOR 1200 OR 3 FOR 9600"
PRINT "ENTER BAUDRATE SELECTION: 2"; STRING$(3, BKSP$); : INPUT BR!
If BR! = 1 Then GoTo CONNECT
If BR! = 3 Then GoTo CONNECT
BR! = 2
CONNECT:
Print "CONNECT CABLE TO 503TDR"
If BR! = 1 Then CMFILE$ = "COM" + CM$ + ":300,N,8,2,CS,DS,CD": Print "SET 503TDR BAUDRATE TO 300bps": GoTo CURRDATE
If BR! = 2 Then CMFILE$ = "COM" + CM$ + ":1200,N,8,2,CS,DS,CD": Print "SET 503TDR BAUDRATE TO 1200bps": GoTo CURRDATE
If BR! = 3 Then CMFILE$ = "COM" + CM$ + ":9600,N,8,2,CS,DS,CD": Print "SET 503TDR BAUDRATE TO 9600bps": GoTo CURRDATE
CURRDATE:
INPUT "ENTER THE DATE (mm/dd/yy)"; DATE1$
Print "DEFAULT FILE NAME: POST.DAT"
INPUT "ENTER NEW FILE NAME"; FILENAME$
If FileName$ = "" Then FileName$ = "POST.DAT"
PRINT "DO YOU WANT A HARD COPY OF 503TDR DATA N"; STRING$(3, BKSP$); : INPUT ANS$ 'print out of data
If InStr(ANSWER$, ANS$) > 1 Then PRNTR% = -1 Else PRNTR% = 0 'set printer flag based on answer
If PRNTR% Then LPRINT Chr$(27) + Chr$(15) 'compressed printer mode
IF PRNTR% THEN WIDTH LPRINT 132
IF PRNTR% THEN LPRINT TAB(25); "503TDR DATA FROM "; DATE1$: LPRINT : LPRINT
'
PRINT "DO YOU WANT HANDSHAKING MODE Y"; STRING$(3, BKSP$); : INPUT ANS$ ' print cd or print nf
If InStr(ANSWER1$, ANS$) > 1 Then PRNTCD% = -1 Else PRNTCD% = 0 ' set printer flag based on answer
'
If PRNTCD% Then Print: Print: Print "503TDR DATA"; Tab(60); "CHECKSUM"; Tab(70); "RESPONSE" Else Print: Print: Print "503TDR DATA"
Print String$(78, "="
IF PRNTR% THEN LPRINT "503TDR DATA"; TAB(60); "CHECKSUM"; TAB(70); "RESPONSE"
If PRNTR% Then LPRINT String$(78, "="
Open CMFILE$ For Random As #1 Len = 512
Print #3, DATE1$
If PRNTCD% Then GoTo PRINTNF
Thanks in advance to all who take the time to read and respond to this question.
'**** PROCEDURE ****
'
START:
OPEN "O", 3, "DRDUMP.DAT", 512 'Open output data file
Print FF$
Print Tab(28); "CPN TDRDUMP REV. 01/02/96": Print Tab(18); "UTILITY TO DOWNLOAD DATA FROM A 503TDR GAUGE"
Print Tab(15); "THIS VERSION RUNS ONLY WITH THE NEW 503 TANK BOARD": Print
PRINT "ENTER THE COM PORT USED 1"; STRING$(3, BKSP$); : INPUT CM$: IF CM$ = " " THEN CM$ = "1"
If CM$ <> "1" And CM$ <> "2" And CM$ <> "3" And CM$ <> "4" Then CM$ = "1"
Print "BAUDRATE, ENTER 1 FOR 300, 2 FOR 1200 OR 3 FOR 9600"
PRINT "ENTER BAUDRATE SELECTION: 2"; STRING$(3, BKSP$); : INPUT BR!
If BR! = 1 Then GoTo CONNECT
If BR! = 3 Then GoTo CONNECT
BR! = 2
CONNECT:
Print "CONNECT CABLE TO 503TDR"
If BR! = 1 Then CMFILE$ = "COM" + CM$ + ":300,N,8,2,CS,DS,CD": Print "SET 503TDR BAUDRATE TO 300bps": GoTo CURRDATE
If BR! = 2 Then CMFILE$ = "COM" + CM$ + ":1200,N,8,2,CS,DS,CD": Print "SET 503TDR BAUDRATE TO 1200bps": GoTo CURRDATE
If BR! = 3 Then CMFILE$ = "COM" + CM$ + ":9600,N,8,2,CS,DS,CD": Print "SET 503TDR BAUDRATE TO 9600bps": GoTo CURRDATE
CURRDATE:
INPUT "ENTER THE DATE (mm/dd/yy)"; DATE1$
Print "DEFAULT FILE NAME: POST.DAT"
INPUT "ENTER NEW FILE NAME"; FILENAME$
If FileName$ = "" Then FileName$ = "POST.DAT"
PRINT "DO YOU WANT A HARD COPY OF 503TDR DATA N"; STRING$(3, BKSP$); : INPUT ANS$ 'print out of data
If InStr(ANSWER$, ANS$) > 1 Then PRNTR% = -1 Else PRNTR% = 0 'set printer flag based on answer
If PRNTR% Then LPRINT Chr$(27) + Chr$(15) 'compressed printer mode
IF PRNTR% THEN WIDTH LPRINT 132
IF PRNTR% THEN LPRINT TAB(25); "503TDR DATA FROM "; DATE1$: LPRINT : LPRINT
'
PRINT "DO YOU WANT HANDSHAKING MODE Y"; STRING$(3, BKSP$); : INPUT ANS$ ' print cd or print nf
If InStr(ANSWER1$, ANS$) > 1 Then PRNTCD% = -1 Else PRNTCD% = 0 ' set printer flag based on answer
'
If PRNTCD% Then Print: Print: Print "503TDR DATA"; Tab(60); "CHECKSUM"; Tab(70); "RESPONSE" Else Print: Print: Print "503TDR DATA"
Print String$(78, "="
IF PRNTR% THEN LPRINT "503TDR DATA"; TAB(60); "CHECKSUM"; TAB(70); "RESPONSE"
If PRNTR% Then LPRINT String$(78, "="
Open CMFILE$ For Random As #1 Len = 512
Print #3, DATE1$
If PRNTCD% Then GoTo PRINTNF