Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code identity 1

Status
Not open for further replies.

phonebob

Programmer
Jul 16, 2001
4
US
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$ <> &quot;1&quot; And CM$ <> &quot;2&quot; And CM$ <> &quot;3&quot; And CM$ <> &quot;4&quot; Then CM$ = &quot;1&quot;
Print &quot;BAUDRATE, ENTER 1 FOR 300, 2 FOR 1200 OR 3 FOR 9600&quot;
PRINT &quot;ENTER BAUDRATE SELECTION: 2&quot;; STRING$(3, BKSP$); : INPUT BR!
If BR! = 1 Then GoTo CONNECT
If BR! = 3 Then GoTo CONNECT
BR! = 2

CONNECT:

Print &quot;CONNECT CABLE TO 503TDR&quot;
If BR! = 1 Then CMFILE$ = &quot;COM&quot; + CM$ + &quot;:300,N,8,2,CS,DS,CD&quot;: Print &quot;SET 503TDR BAUDRATE TO 300bps&quot;: GoTo CURRDATE
If BR! = 2 Then CMFILE$ = &quot;COM&quot; + CM$ + &quot;:1200,N,8,2,CS,DS,CD&quot;: Print &quot;SET 503TDR BAUDRATE TO 1200bps&quot;: GoTo CURRDATE
If BR! = 3 Then CMFILE$ = &quot;COM&quot; + CM$ + &quot;:9600,N,8,2,CS,DS,CD&quot;: Print &quot;SET 503TDR BAUDRATE TO 9600bps&quot;: GoTo CURRDATE

CURRDATE:

INPUT &quot;ENTER THE DATE (mm/dd/yy)&quot;; DATE1$
Print &quot;DEFAULT FILE NAME: POST.DAT&quot;
INPUT &quot;ENTER NEW FILE NAME&quot;; FILENAME$
If FileName$ = &quot;&quot; Then FileName$ = &quot;POST.DAT&quot;
PRINT &quot;DO YOU WANT A HARD COPY OF 503TDR DATA N&quot;; 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); &quot;503TDR DATA FROM &quot;; DATE1$: LPRINT : LPRINT
'
PRINT &quot;DO YOU WANT HANDSHAKING MODE Y&quot;; 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 &quot;503TDR DATA&quot;; Tab(60); &quot;CHECKSUM&quot;; Tab(70); &quot;RESPONSE&quot; Else Print: Print: Print &quot;503TDR DATA&quot;
Print String$(78, &quot;=&quot;)
IF PRNTR% THEN LPRINT &quot;503TDR DATA&quot;; TAB(60); &quot;CHECKSUM&quot;; TAB(70); &quot;RESPONSE&quot;
If PRNTR% Then LPRINT String$(78, &quot;=&quot;)
Open CMFILE$ For Random As #1 Len = 512
Print #3, DATE1$

If PRNTCD% Then GoTo PRINTNF
 
My first guess would be PowerBASIC, since this is a language very similar to QuickBASIC in which keywords are not automatically capitalized (notice the 'If', 'Print', 'GoTo' above). There may be other BASIC dialects with these properties, but I doubt they would be so similar to QuickBASIC.
 
I would have to agree.

--MiggyD &quot;The world shrinks more and more with every new user online.&quot;
 
I thank all who responded but can you tell me where I may find some information about powerbasic?
 
PowerBASIC is for sale at However, the program should be mostly usable and modifyable as-is with QuickBASIC (the only error with the code segment that you have provided here is that the label 'PRINTNF' is not within this sample of the file). If you have problems editing it with QuickBASIC then by all means post them here, and we will advise you on how to convert parts of the code if they don't conform entirely to QuickBASIC's syntax.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top