Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Coexistence of TCC-RT and TCC/TCMD

Jun
1,092
48
I'm interested in installing and testing TCC-RT to confirm that it runs a script that I want others who do not have TCC to be able to run. I am pretty sure that one can install TCC-RT along with TCC and not encounter any interactions or conflicts, but I'd like to be certain before I try.
 
No interactions or conflicts between TCC and TCC-RT on my systems.

After I get my .btms working,
I always run them with TCC-RT,
to ensure that they will run on any system.

I also run my .btms in PowerShell 5.1 using TCC-RT.

I have it defined in my PowerShell 5.1 $Profile;
Code:
function tccrt
{
  & "C:\Program Files\JPSoft\TCC_RT_36\tcc.exe" /I /Q /C $args
}

Joe
 
Thanks, Joe. I installed it. It took me a while to figure out how to run it.

My question probably made it obvious that I have never before written a script for someone else to use; they have all been for my use, or perhaps in a rare case for another TCC user. This is a script that is going to be used for production work, and there has to be some backup for me in case I'm no longer around to do it.

I have one other script, a mailmerge program, that might be of use to others, but I'm not sure that TCC-RT processes all of the required TCC features. At some point I'll give it a try.
 
Now I have encountered a problem.

My script takes some input text and processes it into HTML for a web page. The output is sent to standard out, which I redirect either to a file or to the clipboard. When I tried to load the saved file in my browser, nothing appeared. When I looked at the output, I saw the problem. TCC-RT sends its version information when it starts, and that becomes a part of the output. Is there a way to suppress that?

If I cannot suppress that initial output, I will have to rewrite the script to accept a filename for the output and write the output to the file. Since the TEXT, ECHOS, and ECHO commands are used extensively throughout the script, it would take some work to make the conversion.
 
Now I have encountered a problem.

My script takes some input text and processes it into HTML for a web page. The output is sent to standard out, which I redirect either to a file or to the clipboard. When I tried to load the saved file in my browser, nothing appeared. When I looked at the output, I saw the problem. TCC-RT sends its version information when it starts, and that becomes a part of the output. Is there a way to suppress that?

If I cannot suppress that initial output, I will have to rewrite the script to accept a filename for the output and write the output to the file. Since the TEXT, ECHOS, and ECHO commands are used extensively throughout the script, it would take some work to make the conversion.
Would it be easier to just post-process the generated HTML file to remove the TCC-RT version information and write to a new file?
 
Would it be easier to just post-process the generated HTML file to remove the TCC-RT version information and write to a new file?

I could do that easily (e.g., head /n+3 /n 100000 infile > outfile), but that's a complexity I'd rather avoid for an unsophisticated user. I suppose I could embed my original script and this extra command in a parent script. Getting rid of the copyright would be better
 
[4NT]
Copyright=No

Does TCC-RT have an INI file?

I tried running the OPTION command and got an error message that OPTION is not a recognized command. I believe that it is on the list of commands absent from RT.

Oops. Although I set up a profile to run TCC-RT in WT, I was not running TCC-RT. It seems that I cannot keep TCC-RT running in a Windows Terminal tab the way I can TCC or CMD. Is that right?

Does TCC-RT have an INI file? I can't find one.
 
Last edited:
It has (or can have) an INI file. I have one with Copyright=No it it and I don't see the banner.
 
Where does it look for an INI file? Did you just create one from scratch? What is its name? Where is all this documented?
 
I don't know for sure but the installation directory is a good bet. Just tonight I installed v36 in the same place where I had an ancient TCC-RT. If you have an INI file this should tell you where it is; be sure to double the %.

Code:
d:\tcc-rt> .\tcc.exe echo %%_ininame

D:\tcc-rt\TCMD.INI
 
Vince, I think that your example is getting the inifile from the parent environment. Did you try running that from a CMD session is WT? This is what I get.

Code:
C:\commands\bat>ver & "C:\Program Files\JPSoft\TCC_RT_36\tcc.exe" echo %%_ininame

Microsoft Windows [Version 10.0.26200.8875]

TCC-RT  36.50.70 x64   Windows 11 [Version 10.0.26200.8875]
Copyright 2026 JP Software Inc.  All Rights Reserved
%_ininame

CMD requires percent signs on both sides of variables, but that does not change anything.

Code:
C:\commands\bat>ver & "C:\Program Files\JPSoft\TCC_RT_36\tcc.exe" echo %%_ininame%%

Microsoft Windows [Version 10.0.26200.8875]

TCC-RT  36.50.70 x64   Windows 11 [Version 10.0.26200.8875]
Copyright 2026 JP Software Inc.  All Rights Reserved
%_ininame%

Apparently, when a variable is not defined, the text "%variable%" is returned, not a null string. (Boy am I glad that I use TCC!!!)

Does TCC-RT support the /Q startup option?

Yes, it does! Hooray. And thank you!

Code:
C:\commands\bat>%tccrt% echo We get the copyright

TCC-RT  36.50.70 x64   Windows 11 [Version 10.0.26200.8875]
Copyright 2026 JP Software Inc.  All Rights Reserved
We get the copyright


C:\commands\bat>%tccrt% /q echo No copyright!
No copyright!
 
Last edited:
The current TCC would turn

Code:
.\tcc.exe echo %_ininame

into

Code:
.\tcc.exe echo D:\tc36\TCMD.INI

Doubling the % makes TCC-RT evaluates the variable. Here it is again.

Code:
d:\tcc-rt> .\tcc.exe echo %%_ininame

D:\tcc-rt\TCMD.INI

See the difference:

Code:
d:\tcc-rt> .\tcc.exe echo %_ininame

D:\tc36\TCMD.INI
 
Vince, I did double the percent signs, and I also tried adding them to the end (which should not have mattered to TCC-RT, right).

Code:
C:\PROGRA~1\JPSoft\TCC_RT_36>ver & tcc.exe echo %%_ininame

Microsoft Windows [Version 10.0.26200.8875]

TCC-RT  36.50.70 x64   Windows 11 [Version 10.0.26200.8875]
Copyright 2026 JP Software Inc.  All Rights Reserved
%_ininame

I'm running the VER command first to show that I am not doing this from a TCC tab in WT. It's a CMD tab. Of course, the difference may be that I do not have an INI file, so the variable does not have a value and returns its own string with the leading percent sign.

Isn't the variable _ininame something specific to TCC?

Code:
C:\PROGRA~1\JPSoft\TCC_RT_36>echo %_ininame
%_ininame

C:\PROGRA~1\JPSoft\TCC_RT_36>echo "%_ininame"
"%_ininame"

C:\PROGRA~1\JPSoft\TCC_RT_36>echo "%_ininame%"
"%_ininame%"
 
I did discover that I can put the directive on the command line.

Code:
C:\PROGRA~1\JPSoft\TCC_RT_36>tcc //Copyright=No echo one
one

The /Q option would be easier for a user with no familiarity with TCC.
 
Now I created a file named tcmd.ini in the TCC_RT_36 directory, and it is found.

Now _ininame gets defined once TCC-RT is running.

Code:
C:\PROGRA~1\JPSoft\TCC_RT_36>tcc echo %_ininame
C:\Program Files\JPSoft\TCC_RT_36\TCMD.INI

Before TCC is running, the variable does not exist (in CMD).

Code:
C:\PROGRA~1\JPSoft\TCC_RT_36>set _ininame
Environment variable _ininame not defined

When running the command in a CMD tab, the string %_ininame has no special meaning and is passed to TCC, where it is evaluated when the ECHO command runs. If the percent sign is doubled, CMD still does nothing, and when TCC sees it, it converts %% to a percent character and displays it.

Code:
C:\PROGRA~1\JPSoft\TCC_RT_36>tcc echo %%_ininame
%_ininame

Getting an inexperienced user to create an INI file is doubtful. The /Q option is still the best solution. The help says that it works only in registered versions of TCC, so apparently TCC-RT is considered registered.
 
@Jay Sage please review what I posted earlier.

It would have answered your question about displaying the version / copyright message.

Also, do not run TCC-RT from TCC.

Run it from either CMD, PowerShell, Cygwin, whatever,
but not from TCC.

_TCCRT is your friend. Use it.

You can run TCC-RT from a WT Tab.

Just use a REPL.

Joe
 
@Jay Sage I don't use an .INI file with TCC-RT.

I find it better to include all aliases/functions/libraray routines in the actual .btm

I also load needed plugins via the .btm,
not automatically via TCC-RT.

An example for loading aliases;
Code:
PS R:\> tccrt test.btm
R:\test.btm:alias.lst not available.
Creating R:\test.btm:alias.lst
Aliases ready to use.
This is alias one
This is alias two
PS R:\> tccrt test.btm
Loading R:\test.btm:alias.lst
This is alias one
This is alias two
PS R:\>

The code;
Code:
@SETLOCAL
@ECHO OFF
if isdir r:\temp set temp=r:\temp

iff exist %_batchname:alias.lst then
  echo Loading %_batchname:alias.lst
  alias /r %_batchname:alias.lst
else
  echo %_batchname:alias.lst not available.
  echo Creating %_batchname:alias.lst
  gosub DefineAliases
  alias /r %_batchname:alias.lst
  echo Aliases ready to use.
endiff

one
two

ENDLOCAL
quit

:DefineAliases
text > %_batchname:alias.lst
one=`echo This is alias one`
two=`echo This is alias two`
endtext
return

Purchase and use CMDebug instead of BDEBUGGER for TCC-RT files.

If you would like more info on how I develop .btms for TCC-RT,
please do not hesitate to ask .

Joe
 
@Jay Sage please review what I posted earlier. It would have answered your question about displaying the version / copyright message.

I saw your comment, but it was more than I could understand at the time. In particular, I didn't know where to look for TCC-RT documentation, and you didn't explain the options or why you were using them.

I have a question about the /C option. That seems to be the default. I cannot get TCC-RT to remain open. If I invoke it with no command to perform, it flashes opens and immediately closes. If I give it a command to run, it runs that command and then closes.

You say not to run it in a TCC session. Why is that? I have been running it only under CMD, but even then there is a problem. Because I use SHRALIAS, the TCC-RT session picks up all the aliases and functions. It seems that in order to test what it would be like on the computer of someone without TCC/TCMD, I would have to shut down SHRALIAS and perhaps close all my regular TCC sessions before starting TCC-RT.

In signing off until next week. I'll definitely have questions for you. However, I don't expect to be developing scripts for other people very often. In fact, this might be the only time.
 
I have a question about the /C option. That seems to be the default. I cannot get TCC-RT to remain open. If I invoke it with no command to perform, it flashes opens and immediately closes. If I give it a command to run, it runs that command and then closes.

That's the whole idea. If you could use it interactively, it would compete with full product, which is where Rex makes his money.
 
That's what I thought., so I was puzzled that Joe suggested using the /C option. It seemed unnecessary. As I understand it, there are some other features that do not work in TCC-RT, so that may have been a sufficient drawback to get people to use the full product.

Am I missing an easier way to get TCC-RT not to inherit aliases and functions from SHRALIAS? I naively thought that by running it under CMD and not TCC I might avoid the sharing, but I was not really surprised. I imagine that it would be enough to unload SHRALIAS before starting TCC-RT. I don't have any more time to play today.
 
Am I missing an easier way to get TCC-RT not to inherit aliases and functions from SHRALIAS? I naively thought that by running it under CMD and not TCC I might avoid the sharing, but I was not really surprised. I imagine that it would be enough to unload SHRALIAS before starting TCC-RT. I don't have any more time to play today.

I don't use TCC-RT myself, so I really don't know. Have you tried the /L startup option?
 
Am I missing an easier way to get TCC-RT not to inherit aliases and functions from SHRALIAS? I naively thought that by running it under CMD and not TCC I might avoid the sharing, but I was not really surprised. I imagine that it would be enough to unload SHRALIAS before starting TCC-RT. I don't have any more time to play today.

At the beginning of your .btm,
add the following;

Code:
iff %_tccrt eq 1 then 
  unalias *
  unfunction *
endiff

Review this post for how I work with aliases/functions/libraries in TCC-RT.

Joe
 
I have a question about the /C option. That seems to be the default. I cannot get TCC-RT to remain open. If I invoke it with no command to perform, it flashes opens and immediately closes. If I give it a command to run, it runs that command and then closes.

/C ensures control returns immediately after the command finishes.

I've always used /C even when running cmd.exe

Joe
 
Hi @Jay Sage
Review the README.TXT file at C:\Program Files\JPSoft\TCC_RT_36\readme.txt

It explains the differences between TCC and TCC-RT.

The help file for TCC-RT is included with CMDebug.

1784334617762.webp


1784334597696.webp


Joe
 
Ref: TCC-RT window closes on launch

Here's the source code to create a REPL for TCC-RT;

Code:
@setlocal
@echo off
:: Read-Eval-Print-Loop
:: Usage: "C:\Program Files\JPSoft\TCC_RT_36\tcc.exe" /I /Q /C repl.btm
Do Forever
  echos %_cwd^>
  input %%thecmd
  call %thecmd
enddo
endlocal

Proof;

1784335850597.webp


Joe
 
Here's the source code to create a REPL for TCC-RT;

Yes, I had thought of that way to make a virtual interactive TCC-RT. I've been too busy with real work to get back to this. I will look at your posts when I do get back to it.

I had tried issuing the command unalias *, and TCC-RT hung in each of several attempts. I don't know why.
 
I had tried issuing the command unalias *, and TCC-RT hung in each of several attempts. I don't know why.
Code:
@SETLOCAL
@ECHO OFF

iff %_tccrt eq 0 then
  echo Do not run %_batchname from TCC.
  echo Run %_batchname using TCC-RT from a non-TCC shell.
  quit
endiff

iff %_tccrt eq 1 then 
  unalias *
  unfunction *
endiff

alias
function
ENDLOCAL

Proof:
Code:
PS R:\> tccrt test.btm
TCC: R:\test.btm [10]  No aliases defined
TCC: R:\test.btm [11]  No functions defined

Works okay here,
with no hanging.

Joe
 
Back
Top