********************************************************************
this part of the program should be unyanked to a file
NEWCMD.DO

do this to everything between the ******* lines then delete that
part of the file

; NEWCMD  RUNS NEWCMD PROGRAM USING DIRECT.* AS DEFAULT
; THIS DO FILE IS USED ONLY ON DIRECT.LST AS THE DEFAULT FILE
; CREATED BY JAMES A. JARBOE IV
; EDUCATIONAL FILMSTRIPS 1401 19TH STREET, HUNTSVILLE TX 77340
:S
XY=0
XY 1 1
:<NEWCMD>
XY 11 20
:<PROCESSING..........PLEASE WAIT>
XY 13 20
:<CURRENT LOG IS ( $:$P )>
LOOKUP DIRECT.LST/
GOTO OUT
LOOKUP DIRECT.CMD/
GOTO PASS
XY 2 1
:<ERASING DIRECT.CMD FILE>
ERASE DIRECT.CMD
;PASS
XY 2 1
:<CREATING NEW COMMAND FILE>
XY 3 1
:<USING " $0 " AS ACTION>
RUN NEWCMD.RUN
DIRECT
$0
ERASE DIRECT.LST
XY 4 1
:R
VUE DIRECT.CMD
:S
:<NEWCMD IS NOW COMPLETE
>
EXIT
;OUT
XY 2 1
:R
DING 2
:<DIRECT.LST WAS NOT FOUND>
XY 3 1
EXIT PROGRAM ABORTED

********************************************************************
====================================================================
this part of the program should be unyanked to a file
NEWCMD.HLP

do this to everything between the ======= lines then delete that
part of the file

Locate the following files in the following accounts

FIND   DO  1     DSK0:[2,2]
NEWCMD DO  2
NEWCMD HLP 18    DSK0:[7,1]
NEWCMD BAS 6     DSK0:[50,45]
NEWCMD RUN 3     DSK0:[7,6]

Grand total of 5 files in 30 disk blocks



FROM:  JAMES A. JARBOE IV
      EDUCATIONAL FILMSTRIPS
      1401 19TH STREET
      HUNTSVILLE, TX 77340
      OCT 5, 1982


Dear AMUS AIDS

 A few months ago in the AMUS NEWSLETTER someone mentioned the use of a
directory file (EX DIR DIRECT.LST=*.BAK) as a command file do an operation of
some sort. I used this technique quite often. The only drawback was that it
was slow after the directory was made. The file had to be VUE'ed, the
unnecessary information (DISK LOCATION, BLOCK NUMBERS, ETC.) had to be
deleted. The spaces between the filename and the extension had to be taken
out and the "." had to be inserted between the filename and the extension.
Then the action you wanted to take place (EX: VUE, PRINT, TYPE, ERASE ) had
to be inserted in front of the filename. That either meant typing the word
infront of all the entries or using some easy symbol then using REPLACE or
(carefully) GLOBAL to replace the symbol with the action word you wanted.
Still all of this was easier than typing in everything.

 Well I figured the ole ALPHA MICRO could do this chore with ease. So I
wrote NEWCMD.BAS. This program (which can be run on its own), looks at the
directory listing (any filename you chose or defaults to DIRECT.LST), and
creates a command file from the directory listing using the directory
listings filename. It places a :T at the beginning of the file, takes the
DISK LOCATION from the listing and makes it a LOG, puts an action word( VUE,
PRINT, TYPE, ETC) places it in front of the filename, takes the spaces
between filename and extension out and puts the "." back in place. Then at
the end of the file it puts a DING 2 and a notice that :< COMMAND FILE IS
FINISHED >. All for a $1.95.

Contents of DIRECT.LST before NEWCMD.BAS

AA     CMD 1     DSK0:[2,2]
APCOMP CMD 2
AR     CMD 1
BAKUP0 CMD 2
BATCH  CMD 1
CHAIN  CMD 1
TYPE   CMD 1
UMAIL  CMD 1
WORD   CMD 1
Total of 9 files in 11 blocks

Contents of DIRECT.CMD after NEWCMD.BAS

:T
LOG DSK0:[2,2]
TYPE AA.CMD
TYPE APCOMP.CMD
TYPE AR.CMD
TYPE BAKUP0.CMD
TYPE BATCH.CMD
TYPE CHAIN.CMD
TYPE TYPE.CMD
TYPE UMAIL.CMD
TYPE WORD.CMD
DING 2
:< COMMAND FILE DIRECT.CMD FINISHED
>

Results: a command file ready to run in under 1 minute

That was easy, but not easy enough. You still had to check for an old
directory listing, erase it if there was one, make a new directory listing,
input the directory file name into NEWCMD.RUN, then enter the action word
into the program and then after the program was complete, VUE the command
file and enter any comments or other oddities, then finish and run.

 That inspired NEWCMD.DO. Let the ALPHA MICRO do the work particularly if
you use the directory default for a listing. NEWCMD.DO is invoked by typing
NEWCMD action-word.
Example  NEWCMD TYPE
This DO file looks up to see if there is a directory listing (default only)
and aborts if ther isn't. If there is then it looks up a DIRECT.CMD and
erases it if there is. Then it automatically fills in the blanks for the
NEWCMD.RUN program using the DO files ARGUEMENT for the action-word.
Then it erases the Directory listing so you're ready for the next time.
Then it VUE's the new command file (DIRECT.CMD), so you can make any addtions
(SLEEP 3, LUED COMMENTS, ETC). Then exits after you exit VUE.

Easy now ? No you still have to make the Directory listing. Well here comes
FIND.DO. FIND.DO is the ultimate (maybe) in automation at this time. It is
invoked by typing FIND filename THEN action-word.
Example:
FIND *.CMD THEN TYPE
This command file deletes the current memory then loads the memory with
necessary command file modules, looks up an old directory listing, erases it
if it is there, makes a new one using the filename argument in the DO file,
then runs the NEWCMD.DO file using the action-word given in FIND.DO.

So now you can create a usable command file in order to do any type of large
operation by typing

FIND *.CMD THEN TYPE

That will do almost everything for you. You still have to put comments in the
command file or other necessary commands.
The different DO. files allow you to start the operation at any point.

FIND filename THEN action-word     for     COMPLETE EVERYTHING TAKEN CARE OF

NEWCMD action-word                 for     ALREADY HAVING A DIRECTORY LISTING

NEWCMD.RUN                         for     ALREADY HAVING A DIRECTORY LISTING
                                          AND INPUTING DATA AS NEEDED
                                          THEN ENVOKING VUE YOURSELF

This only took a couple of three hours programming time, and a couple of
three hours time troubleshooting and bug getting out. I am sure that any or
all of this can and will be modified for your own personal custom use and
should be if you want to use it.
These programs are on the AMUS NETWORK or you can use the listing here.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
; FIND.DO  : IT'S USE IS "FIND filename THEN action-word"
; USED WITH THE NEWCMD.DO TO MAKE THINGS EVEN EASIER
; CREATED BY JAMES A. JARBOE IV
; EDUCATIONAL FILMSTRIPS, 1401 19TH STREET,HUNTSVILLE TX 77340
:S
XY=0
DEL *.*
XY 1 1
:<FIND>
XY 11 20
:<PROCESSING........PLEASE WAIT>
XY 13 20
:<CURRENT LOG IS ( $:$P ) >
XY 2 1
:<LOADING MEMORY >
DSK0:BATCH.CMD[2,2]
:S
LOOKUP DIRECT.LST/
GOTO ON
XY 2 1
:<ERASING OLD DIRECTORY LISTING
>
ERASE DIRECT.LST
;ON
XY 2 1
:<MAKING A DIRECTORY OF $0         >
DIR=$0
NEWCMD $2

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

; NEWCMD  RUNS NEWCMD PROGRAM USING DIRECT.* AS DEFAULT
; THIS DO FILE IS USED ONLY ON DIRECT.LST AS THE DEFAULT FILE
; CREATED BY JAMES A. JARBOE IV
; EDUCATIONAL FILMSTRIPS 1401 19TH STREET, HUNTSVILLE TX 77340
:S
XY=0
XY 1 1
:<NEWCMD>
XY 11 20
:<PROCESSING..........PLEASE WAIT>
XY 13 20
:<CURRENT LOG IS ( $:$P )>
LOOKUP DIRECT.LST/
GOTO OUT
LOOKUP DIRECT.CMD/
GOTO PASS
XY 2 1
:<ERASING DIRECT.CMD FILE>
ERASE DIRECT.CMD
;PASS
XY 2 1
:<CREATING NEW COMMAND FILE>
XY 3 1
:<USING " $0 " AS ACTION>
RUN DSK0:NEWCMD.RUN[7,6]
DIRECT
$0
ERASE DIRECT.LST
XY 4 1
:R
VUE DIRECT.CMD
:S
:<NEWCMD IS NOW COMPLETE
>
EXIT
;OUT
XY 2 1
:R
DING 2
:<DIRECT.LST WAS NOT FOUND>
XY 3 1
EXIT PROGRAM ABORTED

=====================================================================
10      !
20      !
30 ! NEWCMD.BAS TAKES OUT BLANKS BETWEEN FILENAME & EXTENSION & ADDS "."
40 ! BY JAMES A. JARBOE IV
50 ! EDUCATIONAL FILMSTRIPS 1401 19TH STREET, HUNTSVILLE TX 77340
60              ! THIS PROGRAM TAKES A DIRECTORY FILE, OPENS IT, READS IT
70              ! THEN TAKES THAT FILE ADDS THE '.' BETWEEN FILENAME AND THE
80              ! EXTENSION. IT ALSO ADDS AN ACTION WORD IN FRONT OF THE
90              ! FILENAME (EXAMPLE:  TYPE, ERASE, COPY, PRINT, ETC.
100             ! THEN PUTS IT IN A FILE WITH THE EXTENSION OF ."CMD"
110             ! MAKING IT READY FOR YOU TO PROCESS AS A COMMAND
120             !
130 STRSIZ 80
140 MAP1 WORKSPACE
150     MAP2 SORCE,S,80                 ! Main file input line
160     MAP2 NAME$,S,10                 ! Name of main file
170     MAP2 SNAME$,S,10                ! Name of work file
180     MAP2 EXT$,S,3                   ! File extensions to work on
190     MAP2 A$,S,4,".LST"              ! Default Main File
200     MAP2 B$,S,4,".CMD"              ! Default Work File
210             !
220 ?TAB(-1,0);"UTILITY TO CREATE A .CMD FILE FROM A DIRECTORY LISTING"
230             !
240 PROGRAM:
250             ?:INPUT "ENTER NAME OF FILE TO PROCESS ? ";NAME$
260             IF NAME$[1,6]=" " THEN NAME$="DIRECT"
270             CALL DEFAULT
280             LOOKUP NAME$,CHECK
290             LOOKUP SNAME$,CHECK'2
300             IF CHECK=0 THEN ? CHR(7);NAME$;" NOT FOUND!": GOTO PROGRAM
310             IF CHECK<0 THEN ? CHR(7);NAME$;"IS A RANDOM FILE" : GOTO OUT
320             IF CHECK'2>0 THEN ? CHR(7);SNAME$;" ALREADY EXISTS" : CALL DO'YOU
330             IF CHECK'2<0 THEN ? CHR(7);SNAME$; "IS A RANDOM FILE" : GOTO OUT
340             ?:INPUT "ENTER THE ACTION TO TAKE PLACE ",ACT$
350 OPEN #1, NAME$,INPUT
360 OPEN #2, SNAME$,OUTPUT
370             ?:?:? "PROCESSING .... PLEASE WAIT"
380             ? #2,":T"
390 LOOP:       INPUT LINE #1, SORCE
400             IF EOF(1)=1 GOTO FINISH
410             IF SORCE=" " THEN GOTO LOOP
420             IF SORCE[18,20]="DSK" THEN ?#2,"LOG "+SORCE[18,LEN(SORCE)]
430             IF SORCE[1,8]="Total of" THEN GOTO LOOP
440             IF SORCE[1,8]="Grand to" THEN GOTO LOOP
450             EXT$=SORCE[8,10]
460             ST=1
470 REPARE:     A=INSTR(ST,SORCE,EXT$)
480             IF A=0 GOTO DO'IT
490             IF SORCE[A-1,A-1]>" " THEN ST=A+3 : GOTO REPARE
500 AGAIN:
510             IF SORCE[A-1,A-1]=" " THEN A=A-1 : GOTO AGAIN
520             SORCE[A,A]="."
530             SORCE[A+1,A+3]=EXT$
540             SORCE[A+4,LEN(SORCE)]=SPACE$(80)
550             IF ACT$=" " THEN GOTO DO'IT
560             SORCE=ACT$+" "+SORCE
570 DO'IT:
580             ? ".";
590             ?#2, SORCE
600             GOTO LOOP
610
620 FINISH:
630             ?#2,"DING 2":?#2,":< COMMAND FILE "+SNAME$+" FINISHED ":?#2,">"
640             ?:? "LAST LINE COMPLETED ":?: CLOSE #1: CLOSE #2
650             ?"YOUR FIXED FILE EXISTS ON DISK AS ( ";SNAME$;" )"
660             END
670 DO'YOU:
680             INPUT "DO YOU WISH TO DELETE IT ?",ANS$
690             IF ANS$[1,1]="Y" THEN RETURN
700 OUT:
710             ?"PROGRAM ABORTED"
720             END
730 DEFAULT:
740             SNAME$=NAME$
750             G=INSTR(1,NAME$,"."):IF G>0 THEN SNAME$[G,G+4]=B$ : RETURN
760             NAME$=NAME$+A$
770             SNAME$=SNAME$+B$
780             RETURN
790     !