<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pickwiki.org/index.php?action=history&amp;feed=atom&amp;title=BPTest</id>
	<title>BPTest - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pickwiki.org/index.php?action=history&amp;feed=atom&amp;title=BPTest"/>
	<link rel="alternate" type="text/html" href="https://pickwiki.org/index.php?title=BPTest&amp;action=history"/>
	<updated>2026-04-28T23:20:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://pickwiki.org/index.php?title=BPTest&amp;diff=1579&amp;oldid=prev</id>
		<title>Conversion script: link fix</title>
		<link rel="alternate" type="text/html" href="https://pickwiki.org/index.php?title=BPTest&amp;diff=1579&amp;oldid=prev"/>
		<updated>2015-02-26T23:48:53Z</updated>

		<summary type="html">&lt;p&gt;link fix&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[BasicSource|Back to Source Code page]]&lt;br /&gt;
&lt;br /&gt;
This program is designed to run BASIC code from ECL[[/TCL]].&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
!&lt;br /&gt;
** Run BASIC code from TCL (command line)&lt;br /&gt;
** (C) Copyright 1985-2007, Advantos Systems, Inc.  All Rights Reserved.&lt;br /&gt;
!&lt;br /&gt;
** Last Modified: 12 Jan 2006, wph&lt;br /&gt;
** First Created: 25 Feb 2001, wph&lt;br /&gt;
** Program Type-: Utility&lt;br /&gt;
!&lt;br /&gt;
** Notes:&lt;br /&gt;
**&lt;br /&gt;
** This process simply builds a BASIC program from the command line,&lt;br /&gt;
** compiles it, runs it, decatalogs it, then deletes it.  Multiple&lt;br /&gt;
** lines can be created at &amp;#039;TCL&amp;#039; by separating them with a &amp;#039;;&amp;#039;.&lt;br /&gt;
**&lt;br /&gt;
** This program will parse out each line and create it as a separate&lt;br /&gt;
** line in the temporary program.  Of course, a &amp;#039;;&amp;#039; can be part of&lt;br /&gt;
** a quoted string but cannot be part of a comment.&lt;br /&gt;
**&lt;br /&gt;
** It&amp;#039;s always a good idea to use &amp;#039;END&amp;#039; statements, e.g.&lt;br /&gt;
**&lt;br /&gt;
** :BPTEST PROMPT &amp;#039;&amp;#039; ; C.BCK = @(-9) ; TEST = &amp;quot;NOW IS THE TIME&amp;quot; ; ANS = &amp;#039;&amp;#039; ;&lt;br /&gt;
**  LOOP UNTIL ANS = &amp;#039;X&amp;#039; DO ; ECHO OFF ; INPUT ANS,1 : ; ECHO ON ; IF ANS &lt;br /&gt;
**  NE &amp;quot;&amp;lt;&amp;quot; THEN CRT ANS : ELSE CRT C.BCK : ; REPEAT ; END&lt;br /&gt;
**&lt;br /&gt;
**-------------------------------------------------------------------**&lt;br /&gt;
**                                                                   **&lt;br /&gt;
**                    I N I T I A L I Z A T I O N                    **&lt;br /&gt;
**                                                                   **&lt;br /&gt;
**-------------------------------------------------------------------**&lt;br /&gt;
*&lt;br /&gt;
** Initialize local variables&lt;br /&gt;
*$OPTIONS EXT                  ; ** D3 version&lt;br /&gt;
NULL$ = &amp;#039;&amp;#039;&lt;br /&gt;
SP1   = &amp;#039; &amp;#039;&lt;br /&gt;
aList = 0                     ; ** is a list active?&lt;br /&gt;
&lt;br /&gt;
** set unique key for bp item&lt;br /&gt;
[[BpId]] = &amp;#039;[[BpTest_]]&amp;#039; : SYSTEM(12) : SYSTEM(16)&lt;br /&gt;
&lt;br /&gt;
** parse tcl sentence to get BASIC commands&lt;br /&gt;
[[TclLine]] = @SENTENCE           ; ** UD version&lt;br /&gt;
*[[TclLine]] = @COMMAND            ; ** UV version&lt;br /&gt;
*TCLREAD [[TclLine]]               ; ** D3 version&lt;br /&gt;
[[TclLine]]   = [[TclLine]][7,9999]   ; ** remove the command&lt;br /&gt;
HELP.CMD  = FIELD(TRIM([[TclLine]]), &amp;#039; &amp;#039;, 1)&lt;br /&gt;
IF HELP.CMD = &amp;#039;?&amp;#039; THEN GOTO DISPLAY.HELP&lt;br /&gt;
&lt;br /&gt;
** Open File(s)f&lt;br /&gt;
FName = &amp;#039;SAVEDLISTS&amp;#039;          ; ** U2 version&lt;br /&gt;
*FName = &amp;#039;DTATEMP&amp;#039;             ; ** D3 version&lt;br /&gt;
OPEN &amp;#039;&amp;#039;, FName TO [[BpTemp]].fv ELSE STOP 201, FName&lt;br /&gt;
*&lt;br /&gt;
**-------------------------------------------------------------------**&lt;br /&gt;
**                                                                   **&lt;br /&gt;
**                 S T A R T   P R O G R A M   R U N                 **&lt;br /&gt;
**                                                                   **&lt;br /&gt;
**-------------------------------------------------------------------**&lt;br /&gt;
*&lt;br /&gt;
** save any active list to get later&lt;br /&gt;
IF SYSTEM(11) THEN&lt;br /&gt;
   aList = 1&lt;br /&gt;
   EXECUTE \SAVE-LIST \ : [[BpId]] CAPTURING Output&lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
** convert program to separate lines&lt;br /&gt;
[[QuoteStr]]   = &amp;#039;&amp;quot;\&amp;#039; : &amp;quot;&amp;#039;&amp;quot;        ; ** list of quote characters&lt;br /&gt;
[[InQuotes]]   = NULL$             ; ** we&amp;#039;re not in a quote section yet&lt;br /&gt;
[[InFunction]] = NULL$             ; ** we&amp;#039;re not in a function section&lt;br /&gt;
[[OrigProg]]   = [[TclLine]]&lt;br /&gt;
[[NewProg]]    = NULL$&lt;br /&gt;
xHigh      = LEN([[OrigProg]])&lt;br /&gt;
&lt;br /&gt;
** parse through looking for separate lines of code&lt;br /&gt;
FOR X = 1 TO xHigh&lt;br /&gt;
   [[TestChar]] = [[OrigProg]][X,1]&lt;br /&gt;
   IF INDEX([[QuoteStr]], [[TestChar]], 1) THEN&lt;br /&gt;
      IF [[InQuotes]] = NULL$ THEN&lt;br /&gt;
         [[InQuotes]] = [[TestChar]]&lt;br /&gt;
      END ELSE&lt;br /&gt;
         IF [[InQuotes]] = [[TestChar]] THEN [[InQuotes]] = NULL$&lt;br /&gt;
      END&lt;br /&gt;
   END ELSE&lt;br /&gt;
      IF [[TestChar]] = &amp;#039;(&amp;#039; THEN&lt;br /&gt;
         IF [[InFunction]] = NULL$ THEN [[InFunction]] = [[TestChar]]&lt;br /&gt;
      END&lt;br /&gt;
      IF [[TestChar]] = &amp;#039;)&amp;#039; THEN&lt;br /&gt;
         IF [[InFunction]] NE NULL$ THEN [[InFunction]] = NULL$&lt;br /&gt;
      END&lt;br /&gt;
   END&lt;br /&gt;
   IF [[TestChar]] = &amp;#039;;&amp;#039; THEN&lt;br /&gt;
      IF [[InQuotes]] = NULL$ AND [[InFunction]] = NULL$ THEN [[TestChar]] = @AM&lt;br /&gt;
   END&lt;br /&gt;
   [[NewProg]] := [[TestChar]]&lt;br /&gt;
NEXT X&lt;br /&gt;
&lt;br /&gt;
** start program run&lt;br /&gt;
WRITE [[NewProg]] ON [[BpTemp]].fv, [[BpId]]&lt;br /&gt;
EXECUTE \COMPILE \ : FName : SP1 : [[BpId]] RETURNING [[ErrNo]]&lt;br /&gt;
IF [[ErrNo]] NE 0   THEN                                        ; ** U2 version&lt;br /&gt;
*IF [[ErrNo]] =  241 THEN                                        ; ** D3 version&lt;br /&gt;
   IF aList THEN&lt;br /&gt;
      EXECUTE \GET-LIST \ : [[BpId]] CAPTURING Output&lt;br /&gt;
   END&lt;br /&gt;
   EXECUTE \RUN \ : FName : SP1 : [[BpId]]&lt;br /&gt;
   EXECUTE \DELETE \ : FName : SP1 : &amp;#039;_&amp;#039; : [[BpId]] CAPTURING Output  ; ** UD version&lt;br /&gt;
*  EXECUTE \DELETE \ : FName : &amp;#039;.O&amp;#039; : [[BpId]] CAPTURING Output       ; ** UV version&lt;br /&gt;
*  EXECUTE \DECATALOG \ : FName : SP1 : [[BpId]] CAPTURING Output     ; ** D3 version&lt;br /&gt;
END&lt;br /&gt;
EXECUTE \DELETE \    : FName : SP1 : [[BpId]] CAPTURING Output&lt;br /&gt;
*&lt;br /&gt;
GOTO END.OF.PROGRAM&lt;br /&gt;
*&lt;br /&gt;
**----------------------------------------------------------------**&lt;br /&gt;
**                                                                **&lt;br /&gt;
**                     S U B R O U T I N E S                      **&lt;br /&gt;
**                                                                **&lt;br /&gt;
**----------------------------------------------------------------**&lt;br /&gt;
*&lt;br /&gt;
** Help display&lt;br /&gt;
***************&lt;br /&gt;
DISPLAY.HELP:&lt;br /&gt;
***************&lt;br /&gt;
*&lt;br /&gt;
CRT&lt;br /&gt;
CRT &amp;#039;Utility to execute BASIC code.  This is a simple way to run BASIC&amp;#039;&lt;br /&gt;
CRT &amp;#039;code.  If you want to run multiple lines, simply separate lines of&amp;#039;&lt;br /&gt;
CRT &amp;#039;code with &amp;quot;;&amp;quot;, which is the same as you would do in a program&amp;#039;&lt;br /&gt;
CRT&lt;br /&gt;
CRT &amp;quot;Syntax:&amp;quot;&lt;br /&gt;
CRT &amp;quot;  BPTEST {BASIC command(s)}&amp;quot;&lt;br /&gt;
CRT&lt;br /&gt;
CRT &amp;quot;Example:&amp;quot;&lt;br /&gt;
CRT &amp;quot;  BPTEST EXECUTE \TERM\ CAPTURING OUTPUT; CRT OUTPUT&amp;quot;&lt;br /&gt;
CRT&lt;br /&gt;
CRT &amp;quot;^ terminal name: [[ActIbmpc]].c1^ product name: [[AccuTerm]] IBM PC Color&amp;quot;&lt;br /&gt;
CRT &amp;quot;^ terminal width: 80    printer width: 146^          depth: &amp;quot;&lt;br /&gt;
CRT &amp;quot;25            depth: 61^ lineskip:    0^ lf delay:    1^ ff &amp;quot;&lt;br /&gt;
CRT &amp;quot;delay:    1^ back space:  8^&amp;quot;&lt;br /&gt;
CRT&lt;br /&gt;
STOP&lt;br /&gt;
*&lt;br /&gt;
**----------------------------------------------------------------**&lt;br /&gt;
**                                                                **&lt;br /&gt;
**                  E N D   O F   P R O G R A M                   **&lt;br /&gt;
**                                                                **&lt;br /&gt;
**----------------------------------------------------------------**&lt;br /&gt;
*&lt;br /&gt;
***************&lt;br /&gt;
END.OF.PROGRAM:&lt;br /&gt;
***************&lt;br /&gt;
*&lt;br /&gt;
END&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[BasicSource|Back to Source Code page]]&lt;/div&gt;</summary>
		<author><name>Conversion script</name></author>
	</entry>
</feed>