newbie question - scripts

Jul 27, 2019
3
0
Hello ,I'm using the forum to learn about scripts in Take Command. I'm new to the software and to the command line. I have a few questions, thank you for helping me !
1) When a user posts a script example with : ": check-comments.btm" , I assume that I should save the file as *.btm if I copy the script from the forum. Right ?
2) if .btm is not mentioned , then I can save in the other format : .cmd It seems there are two formats available , , with .btm allowing inclusion of advanced commands not interpreted by cmd
3) To edit a script, I use the debugger tool ( in tools / edit -debug
4) to execute a script , I navigate to it in the TCC ( console) ( main page of take command) and press "enter"

==> Is this the correct "workflow" ? Thank you !

5) is there a "(verified) script repositery that could serve as examples or templates ?
 
Aug 23, 2010
488
6
It is strongly suggested to use .btm extension for TC/TCC files.
TakeCommand is not guaranteed to be CMD compatible, although it does its best to support all bugs of the latter.
And of course CMD won't know how to handle TCC specific features.
 
Aug 28, 2019
1
0
Thanks for this thread. I'm new to this light edition TakeCommand thanks to a friend at Apknite recommended. Besides that, thank jpsoft for free TCC/LE.
 
Aug 23, 2010
488
6
Thanks for this thread. I'm new to this light edition TakeCommand thanks to a friend at Apknite recommended. Besides that, thank jpsoft for free TCC/LE.
If you really want to stick to something, that is free and is not POSIX shell, stick to TCC-RT.
TCC/LE is long since dead.
 
Oct 18, 2009
296
12
I'm the one who posted the check-comments.btm program.

You need to be aware that a lot of my stuff was written specifically in TCC/LE. So those tend to use some odd approaches because of things that LE doesn't support but current versions and -RT do:

LE does not support:

* User-defined functions
* Array variables
* ffind doesn't return all the things the non-LE versions do

I don't remember the details, but you'll see things like:

::******************************************************
:FORMAT_SSN [SSN_in SSN_out]
::
:: Adds hyphens to SSN
::
:: Parameters: SSN_in: string in format 143210313
:: Output is returned in %SSN_out, NOT the calling varname
::
:: CALL WITH:
:: GOSUB FORMAT_SSN %SSN
:: Set SSN=%SSN_out
::
::******************************************************

IFF %@len[%@trim[%SSN_in]] EQ 9 THEN
Set SSN_out=%@left[3,%SSN_in]-%@instr[3,2,%SSN_in]-%@right[4,%SSN_in]
ELSE
Set SSN_out=
ENDIFF

RETURN
:: End of FORMAT_SSN [SSN_in SSN_out]

--------------
NOTE SSN_out That was my way of creating a "sort-of" UDF. That technique definitely should not be used!

Also, I tend to write very simple code, almost totally just involving reformatting dates or filenames by using string functions. Often there are much shorter ways to do things with more advanced built-in functions--especially when you get into non-LE's capabilities and plug-ins.