btm won't run in ver. 17 but works in ver. 16

Jun 11, 2008
14
1
66
Washington,DC
I have a command line calendar (like Unix "cal") back in 2008 that for some reason isn't working with:

TCC 17.00.71 x64 Windows 8.1 [Version 6.3.9600]
TCC Build 71 Windows 8.1 Build 9600​

I'm getting the following error:

C:\Util\TCMD17x64\clc.btm [109] Usage : SCRPUT row col [BRIght] fg ON BRIght] bg text

Line 109 reads:

scrput %row %c bla on whi %z

Where
%row = the row number
%c = the column number
edited to
%z = %@char[32] (the only way I know of to get a leading blank space printed to screen.)
from
%z = ASCII 255

If I run it with different parameters I will eventually get scrput errors for other lines.

Except for the directory names the ini files are the same.

If wanted I can post files and pictures on a web page.


In another btm ver. 17 is also not showing ASCII boxes as lines.
 
Last edited:
Jun 11, 2008
14
1
66
Washington,DC
Here's the command line calendar (CLC) code. The parameters are explained at the bottom (help section).

The problem line is 110 here I made a spacing change to the code.

Sorry about not using a code box, I don't see the option in my browser.

::::::::::::::::::::::::::::::::::::::::::::::::::::
:: ::
:: Command Line Calendar (CLC) is is an emulation ::
:: the Unix/Linux cal utility. ::
:: ::
:: Written by Robin Douglas, it's a modified port ::
:: of an old BASIC program, and distributed as is ::
:: for whom ever wants it. It comes with no ::
:: guarantees or warranties to not be harmful or ::
:: be useful in any way, shape, or form. ::
:: ::
::::::::::::::::::::::::::::::::::::::::::::::::::::

@echo off
setlocal
set FDay=0
if %1 = s set FDay=1 %+ goto Use.Today
if !%1==! goto Use.Today
if %@numeric[%1] eq 0 .or. %1 lt 1 .or. %@len[%1] lt 1 .or. %@len[%1] eq 3 .or. %@len[%1] gt 4 goto Get.Help
iff %@len[%1] eq 4 .and. %1 ge 1583 then
if %2 = s set FDay=1
goto Make.Year
endiff
if %1 lt 1 .or. %1 gt 12 goto Get.Help
set b=%1
if %2 = s set FDay=1
if !%2==! .or. %2 = s set a=%_year
if %@len[%2] = 4 set a=%2
if %@len[%a] ne 4 .or. %a lt 1583 goto Get.Help
if %3 = s set FDay=1
goto Make.Month

:Make.Year
set a=%1
set b=1
set e=%_day
set row=%@eval[%_row + 2]
if %row gt %@eval[%_rows - 36] set row=1
if %row eq 1 cls
set d=1
set m=%b
set y=%a
set nm=%m
do mr = 1 to 4

set col=2
do cm = 1 to 3
gosub Make.Cal
set nm=%@inc[%nm]
set m=%nm
set row=%@eval[%row-8]
set col=%@eval[%col+23]
enddo
set row=%@eval[%row+9]
enddo
goto Done

:Use.Today
set a=%_year
set b=%_month

:Make.Month
set e=%_day
set row=%@eval[%_row + 2]
: if %row gt %@eval[%_rows - 10] set row=1
: if %row eq 1 cls
set d=1
set m=%b
set y=%a
set col=25
gosub Make.Cal

:Done
set row=%@dec[%row]
screen %row 0 %z
endlocal
quit

:Make.Cal
set z=%@char[32]
gosub Zeller's.congruence
set n2=%n
gosub Day.Of.Year
(set n1=%n %+ set m1=%m)
set m=%@inc[%m]
iff %m gt 12 then
set n3=31
else
(gosub Day.Of.Year %+ set n3=%@eval[%n - %n1])
endiff
set n=%@substr[JanFebMarAprMayJunJulAugSepOctNovDec,%@eval[3 * %m1 - 3],3]
scrput %row %col bla on whi %n %y
set row=%@inc[%row]
iff %FDay=1 then

scrput %row %col red on whi %z Su
scrput %row %@eval[%col + 3] bla on whi %z Mo Tu We Th Fr
scrput %row %@eval[%col +18] red on whi %z Sa
else
scrput %row %col bla on whi Mo Tu We Th Fr
scrput %row %@eval[%col +15] red on whi %z Sa Su
endiff
set row=%@inc[%row]
set l=0

do i = 1 to 6
set c=%col
set g=1
set wkd=0

do j = 1 to 7
set s=%c
iff %g lt %@eval[%n2 + 1] .and. %i eq 1 .or. %l ge %n3 then

scrput %row %c bla on whi %z
elseiff %m1 eq %_month .and. %y eq %_year .and. %@inc[%l] eq %e then
set l=%@inc[%l]
if %l le 9 set s=%@inc[%s]

scrput %row %s cya on whi %l
elseiff (%FDay = 1 .and. %wkd = 0 .or. %wkd = 6) .or. (%FDay = 0 .and. %wkd ge 5) then
set l=%@inc[%l]
if %l le 9 set s=%@inc[%s]

scrput %row %s red on whi %l
elseiff %m1 ne %_month .or. %y ne %_year .or. %@inc[%l] ne %e then
set l=%@inc[%l]
if %l le 9 set s=%@inc[%s]

scrput %row %s bla on whi %l
endiff
set wkd=%@inc[%wkd]
set c=%@eval[%c+3]
set g=%@inc[%g]
enddo
set row=%@inc[%row]
enddo
return

:Zeller's.Congruence
iff %m gt 2 then

(set mz=%@eval[%m - 2] %+ set yz=%y)
else
(set mz=%@eval[%m + 10] %+ set yz=%@eval[%y - 1])
endiff
(set cz=%@eval[%yz \ 100] %+ set dz=%@eval[%yz - 100 * %cz])
set n=%@eval[((13 * %mz -1) \ 5) + %d + %dz + (%dz \ 4) + (%cz \ 4) - %cz - %cz + 77]
set n=%@eval[%n - 7 * (%n \ 7)]
if %FDay = 0 (set n=%@dec[%n] %+ if %n lt 0 set n=6)
return

:Day.Of.Year
set n=%@eval[(3055 * (%m + 2) \ 100) - 91]
gosub leap.year
if %m gt 2 set n=%@eval[%n - 2 + %lp]
set n=%@eval[%n + %d]
return

:Leap.Year
set lp=0
if %@eval[%y %% 4] == 0 set lp=1
if %@eval[%y %% 100] == 0 set lp=0
if %@eval[%y %% 400] == 0 set lp=1
return

:Get.Help
text

----------------------------------------------------------------------

NOTE: CLC will not do years prior to 1583 or after 9999, this was
done intentionally as an error prevention measure.

For years prior to 1583 this is technically correct. The Gregorian or the
current solar calendar was Decreed by Pope Gregory XIII in a papal bull
in February 1582, to correct an error in the Julian calendar by suppressing
10 days, causing Oct 5 to become Oct 15. It was not adopted by Great
Britain and the American colonies until 1752.

See http://calendopedia.com/gregory.htm for a list of when the different
countries adopted the this calendar.

As for after 9999, it my be my limited sense of reality, but I don't
really think it's necessary.
----------------------------------------------------------------------

The correct format for CLC is:

CLC s - the week starts on Sunday (must be first)

CLC month - i.e. CLC 5 - for May of the current year.

or:

CLC month year - i.e. CLC 5 1957 - for May 1957

or:

CLC year - i.e. CLC 1957 - for the entire year of 1957

months need to be between 1 an 12
years need to have 4 digits i.e. 1957
----------------------------------------------------------------------

endtext
set row=%_row
goto Done
 
Last edited:
The .BTM works with no errors on my
Code:
TCC  16.03.55  Windows Vista [Version 6.0.6002]
TCC Build 55  Windows Vista Build 6002  Service Pack 2

but gives the same error that op got on my
Code:
TCC  17.00.71  Windows Vista [Version 6.0.6002]
TCC Build 71  Windows Vista Build 6002  Service Pack 2

Joe
 
May 20, 2008
11,400
99
Syracuse, NY, USA
A simple test is OK here. Could it depend on what @CHAR[255] is?
upload_2015-1-30_20-27-13.png
 

rconn

Administrator
Staff member
May 14, 2008
12,344
149
TCC (in both v16 and v17) strips trailing spaces from the line. In v16, SCRPUT with no text argument does nothing. In v17, SCRPUT complains.

The question is whether you would rather have SCRPUT not do anything (and not tell you that it's not doing anything), or return an error in this case?
 
Jun 11, 2008
14
1
66
Washington,DC
TCC (in both v16 and v17) strips trailing spaces from the line. In v16, SCRPUT with no text argument does nothing. In v17, SCRPUT complains.

The question is whether you would rather have SCRPUT not do anything (and not tell you that it's not doing anything), or return an error in this case?

Then the question is, is there a way to print a blank space (%@char[32]) as the last character in v 17 without the error message without asking you to do a rewrite?
 
Similar threads
Thread starter Title Forum Replies Date
Ville TCC won't close after .btm execution Support 4
vefatica Console not redrawn in BTM or with multiple commands Support 4
Joe Caverly Embedding an .EXE (or other file) into a .BTM Support 8
Charles S. Roaten Problems with TCSTART.BTM Support 1
P Kill all other instances of tcc from a btm batch file Support 2
C TCC 26 BATCOMP BTM problems? Support 5
B IF command problem in tcexit.btm Support 9
vefatica WAD DIR.BTM? Support 11
vefatica BTM, elevated, console window caption? Support 4
I BTM slower than BAT? Support 14
D btm file command line augments comparing for string or math. Support 12
D check for network tcstart.btm and load if newer Support 3
Craig Fitzgerald Problems using tcstart.btm Support 3
vefatica Installer sets BTM associations wrongly Support 4
O I cannot use links to .btm files Support 5
CWBillow Can't right-click a BTM Support 7
C NE1 have BTM to remove %appdata\JP Software\ etc... Support 0
C interesting TCStarts.btm Support 2
JohnQSmith ALIAS /R in TCSTART.BTM Support 9
Paul Berwanger BTM Bugs Support 2
M Drag and Drop for .BTM scripts Support 10
D WAD START /ELEVATED "Title" /PGM "job.btm" Support 6
C How to? run a BTM in elevated, inv tcc tab window Support 9
Roedy How to? Understanding BTM file properties Support 0
Fross GetOpt.btm Support 0
Roedy BTM file encoding Support 13
C How to? Add date/time to custom tpipe based BTM Support 1
thedave Problem chaining piped FIND commands in BTM Support 7
P Concatenating strings in a BTM Support 3
C Cmpr_Del.btm need help understanding UDF..... Support 2
R Unable to start any BTM file from Explorer Support 5
G .BTM association doesn't work anymore Support 1
A 18.00.21 tries to cancel TCSTART.BTM Support 3
B How to? why does my BTM stop Support 2
I How to? Bat Works but BTM Doesn't Support 6
C Documentation .CMD .BAT .BTM Support 15
C TCMD17x64\tcchere.btm Support 3
T How to? sort history in tcexit.btm Support 22
Mezlo help with btm fragment Support 9
C REQ: tcmdhere.btm mod Support 11
vefatica Why isn't TCSTART.BTM run? Support 8
vefatica BTM file hoses logon session Support 12
C move_all.btm Support 34
J Passing % character through command line to .btm Support 5
C @CharlesDye - RegTweaks.btm n/w Support 11
C z_newmove.btm questions Support 6
R Drag to BTM no longer works in Windows 8.1 Support 10
T Associating BTM files with IDE results in DOS box Support 33
MickeyF Why does my tcstart.btm sometimes terminate tcc.exe? Support 4
Mordachai How to get a TC interface instead of a console for .btm, .bat, ? Support 10

Similar threads