My preference is to name batch files with a BTM extension only if they don't work in cmd.exe. (That is, only if they are using TCC specific functions or syntax.)
For batch files that work in cmd.exe I use the CMD extension. I never use BAT any more.
It would be kind of cool if I could figure out how to get TCC to execute all *.cmd batch files using cmd.exe directly (to avoid the instances where TCC isn't fully compatible with cmd syntax). Started a thread on this a while back but was never able to get it to work as I expected.
.BTM (load entire file in memory before executing, hence run quicker, can NOT modify dynamically,
.BAT (loads and runs file line by line, hence slower then .BTM, can modify dynamically,
.CMD (same as .BAT, extension is same as MSDos's CMD.EXE)
EXTPROC and /* */ is inherited from OS/2 cmd.exe, by way of 4os2 to 4nt.
You can write command processors in REXX, and then have the data file in a .CMD file. REXX scripts work fine as extproc command processors. I have a kind of home grown WEAVE (see Donald Knuth), which processes .CMD files by weave, and writes nicely synched sets of files, all without a hint of comment, because in literate programming, such as by DK and myself, you write the process as a paper, and syphon out stuff to compile/run.
This is an External processor simpcalc.rex, and one of its command files. Using a slightly greater parsing process, one can get it to print out fully formatted tables, for different measuring systems. The tables in http://z13.invisionfree.com/DozensOnline/index.php?showtopic=872 actually reside in an EXTPROC batch, where
produces this table in the measurement system 'ko', and a different command "constants mks" will produce the same in MKS.
The expanded extproc command is regina.exe systemx.rex constants.cmd ko, the systemx.rex by extproc, and regina.exe by set .rex=regina.exe
I was searching for a possible way to add the filetype of REX (or REXX) to the existing executables, like; EXE, BAT, CMD .. etc..
I added both REX & REXX to PATHEXT, but just entering "TEST" (for my simple TEST.REX file), at the command prompt, does not execute
the TEST.REX. Entering "TEST.REX" does execute it.
I'd like to add .rex & .rexx as extensions that do not need to be typed with the filename, and have ASSOC & FTYPE handle my rex
processor without specifying the extension, but haven't found it.
I found the above post about a CMD file having /* ... */ in the first line calling the rex processor so I renamed that my TEST.REX file to TRY.CMD
but when I entered "TRY" (without the extension), it *crashed* TakeCommand ! ! ..
Bug? Misunderstanding? Or? I'm still on R11 of TC.
Is there a way to add .rex to the list of executables that DON'T need the extension explicitly added?
-- update.. Don't know why I had that crash.. Brought TC back up and the "/*...*/" bit works now ? .. sigh.... stuff happens
None of JP processors have rexx bundled with them, but there are two excellent ones out there: Regina.rexx (which is classic rexx), and OORexx (object orientated rexx). You have to install one of these, or at least extract the various executables. Lua seems to be the first bundled processor, but you wonder why they don't just provide a lua interface, eg (tcc.wildspec) and let people download their own lua?
You need at a minimum, regina.dll and regina.exe, but there are other DLLs worth getting, such as Patrick McPhee's W32UTIL and SYSUTILS (now in regina). Documentation is in PDF, but quite servicable. (I use a windows IPF viewer, and the DOSREXX.INF from PC-DOS 7 for my needs.
I use regina rexx. Once this is installed, and 'assoc .rex' gives a decent answer, you can indeed do things like add .REX to the PATHEXT environment, or `set .rex=regina.exe`. It even works (gosh), if you put .REX in the string built into cmd.exe. But you have to provide your own rexx processor!
EXTPROC works with rexx scripts. The example in the 4NT.HLP file suggests that there is an EXE file processing it, but you can use a grotty REXX script to do it. This means, for example, that ye can write up a line-processing calculator, and have nice formatted documents with calculations from a rough list of names and equations.
REXX was IBM's glue language, and all command processors were supposed to be able to run batch files written in REXX. This is why you see .CMD and .BAT files designed to run REXX if they start /*. It's a nice language, but don't expect to do anything stupid like calculating the array suffix in place (ie T =P.(X-1) does not work, but Y=X-1; T=P.Y gives the right answer.)