Declined Add library functions to shralias saving feature

May 20, 2008
130
1
CA
I would like to have my library functions saved to %SHRALIAS_SAVE_PATH as library.sav if possible
 
  • Like
Reactions: rps
May 20, 2008
11,411
99
Syracuse, NY, USA
I would like to have my library functions saved to %SHRALIAS_SAVE_PATH as library.sav if possible
... and automatically loaded from there? I guess I don't really understand. Library functions must be in files, on disk, before they're used. If they are in the canonical place, they're loaded automatically. If you want to load them manually, you can put them wherever you want.
 
May 20, 2008
130
1
CA
You have a point there, so what I'm asking for if we could make library functions global across sessions (where they're local now)
 

rps

Jul 6, 2008
436
6
I would like to have my library functions saved to %SHRALIAS_SAVE_PATH as library.sav if possible
Actually I would like to modify this very good suggestion.

My modification is to have a %Function_Save_Path that defines an independent location for automatically & manually saved user-defined variable and library functions. This way the user can keep the alias, history, and dirhistory lists in one directory and user-defined variable & library functions in another.

  1. If Function_Save_Path is not defined then SHRALIAS_SAVE_PATH, if defined, would dictate.
  2. Function_Save_Path could be defined even if SHRALIAS_SAVE_PATH isn't.
  3. All user-defined variable & library functions would be automatically save in the appropriate defined function_save_path.
  4. All user-defined variable & library functions could be automatically loaded during TCC startup. Controlled by a tcmd.ini directive.
I think this modified suggest accomplishes what Federico's OP requested as well as a few extras.

Rexx, if needed, I will add these as individual suggestions.
 
May 20, 2008
11,411
99
Syracuse, NY, USA
I like the idea of global (shared) library functions. But I must chime in against most of what else has been suggested. I see no benefit from being able to specify the location of function.sav separately from the location of alias.sav, dirhistory.sav, and history.sav.

And I still don't know what's meant by saving library functions. They're in files to begin with and (except for deletion) the in-memory copy of a library function can't be modified. So what's the saving all about? And how would SHRALIAS know how to save them? My library functions come from 4 different files and I imagine that once they're in memory, all knowledge of where they came from has been lost.
 

rps

Jul 6, 2008
436
6
I like the idea of global (shared) library functions. But I must chime in against most of what else has been suggested. I see no benefit from being able to specify the location of function.sav separately from the location of alias.sav, dirhistory.sav, and history.sav.

And I still don't know what's meant by saving library functions. They're in files to begin with and (except for deletion) the in-memory copy of a library function can't be modified. So what's the saving all about? And how would SHRALIAS know how to save them? My library functions come from 4 different files and I imagine that once they're in memory, all knowledge of where they came from has been lost.

Interesting since added flexibility is the goal. If not why not is a question I often ask myself when making or supporting suggestions. Don't you use the /U(pdate functions) to update the in-memory Library function without deleting and reloading?

So I believe the current definitions for user-defined functions are automatically saved. This leads to also saving Library functions.

I think we can define multiple Library functions in a single file, as with user defined functions, so why not save them in a single file, in a specified directory, if the user wants? The current SHRALIAS_SAVE_PATH offers only two options; the suggested Function_Save_Path just seemed like a logical progression, giving the user added flexibility.

As previously stated, the reason for specifying where functions are saved and read from is so the user can save the user-defined & library functions in a directory other than that defined by SHRALIAS_SAVE_PATH. The beginning suggestions only wanted to auto-save the Library functions in SHRALIAS_SAVE_PATH which I gave a thumbs up.

Sorry to here your library functions are not "organized". :smile:
 
May 20, 2008
11,411
99
Syracuse, NY, USA
I still don't get the saving of library functions. I do use /U. But in order to use /U, the updated version must already be in a (already saved) file.

I do put more than one library function into a single file. In fact I put various collections of related ones into various files with appropriate names. I'd call that "orgnized".
 
Oct 18, 2009
362
17
Slightly off topic, though not much ...

I haven't used the library capability, so I'm not familiar with the details.

Can a library routine / function load other ones? I'm thinking a "master" routine/function that loads other library files.
 
May 20, 2008
11,411
99
Syracuse, NY, USA
Slightly off topic, though not much ...

I haven't used the library capability, so I'm not familiar with the details.

Can a library routine / function load other ones? I'm thinking a "master" routine/function that loads other library files.
Sure. I couldn't think of a reason why not, but I just tested anyway. In lib1.txt (automatically loaded) I put
Code:
loadextras {
library /r g:\tc23\library\extras\extras.txt
}
When I executed LOADEXTRAS, the functions in g:\tc23\library\extras\extras.txt were loaded.
 
Oct 18, 2009
362
17
Actually I would like to modify this very good suggestion.

My modification is to have a %Function_Save_Path that defines an independent location for automatically & manually saved user-defined variable and library functions. This way the user can keep the alias, history, and dirhistory lists in one directory and user-defined variable & library functions in another.

  1. If Function_Save_Path is not defined then SHRALIAS_SAVE_PATH, if defined, would dictate.
  2. Function_Save_Path could be defined even if SHRALIAS_SAVE_PATH isn't.
  3. All user-defined variable & library functions would be automatically save in the appropriate defined function_save_path.
  4. All user-defined variable & library functions could be automatically loaded during TCC startup. Controlled by a tcmd.ini directive.

I can see several uses for that:

a) With multiple users, library functions, etc., can be saved to a common folder but other things like history can be saved to a separate folder for each user.

b) Where the same program will be used for multiple data sets. For instance, Customers A, B and C. Set paths and run the program for Customer A. Change the paths and run for Customer B, etc.

c) Multiple versions / copies:

* Development / Test / Debugging copy
* Training copy that will always have the same data
* Demo copy that will always have the same data
* Production copy
 

rps

Jul 6, 2008
436
6
From another Suggestion thread: (Add auto-load directives to tcmd.in)
Rick Reinckens said: If you're going to have two paths where functions might be or two where libraries might be, why not have 2 separate directives for Functions and 2 for Libraries--one for Function_Save_Path and one for Shralias_Save_path?
To clarify, as I understand this addition, the current subject proposal would add a "Function_Save_Path" and a "Library_Save_Path" that both work in cooperation with Shralias_Save_Path .
With the OP and the mods previously outlined above, this modification will add even more user defined flexibility.
Thanks for the input.
 
May 20, 2008
11,411
99
Syracuse, NY, USA
SHRALIAS.EXE is the only program that uses (or even knows about) SHRALIAS_SAVE_PATH. If that variable is in SHRALIAS.EXE's environment, SHRALIAS.EXE will save 4 global lists there (history, dirhistory, aliases, and functions (the @functions) when it exits. It has worked well for many years. If library routines (I don't like calling them functions) become global/shared, SHRALIAS.EXE could be made to guard the new shared memory map as it does the others.

So should there be

1. Shralias_Function_Save_Path
2. Shralias_Alias_Save_Path
3. Shralias_History_Save_Path
4. Shralias_Dirhistory_Save_Path

That seems like flexibility for the sake of flexibility.

Those four lists can change without any file changing (history and dirhistory change all the time, there's ALIAS, FUNCTION, and ESET for changing the other two on the fly). So it's quite reasonable for SHRALIAS.EXE to save those when it exits (which for me is when I logoff).

Library routines cannot be changed/added until they're already in a saved file. SHRALIAS saving them seems ridiculous.

I still haven't figured out most of the current suggestions.
 
May 20, 2008
130
1
CA
I vote for making the library functions global rather than local unless Rex has a reason for why they shouldn't be
 
Similar threads
Thread starter Title Forum Replies Date
R Done Add a .btm LIBRARY system Suggestions 12
Joe Caverly Done Add ability to DEL Stream from SYMLINK Suggestions 2
Joe Caverly Add VHD to @drivetype Suggestions 1
R Option to add tcc to Bash profile Suggestions 1
R Add Custom Message to commands Suggestions 2
mfarah Declined Implement an "Add TCC to the task bar" in the TCMD installer. Suggestions 2
C Declined Add switch to MOVE to not make empty destination folders. (COPY's /F) Suggestions 4
M Add "ReleaseID" (aka version or build) to ver output Suggestions 2
R Declined In setup, add back/refresh buttons. Suggestions 1
D Done Suggestion: Add VIEW option to open in same position as current window Suggestions 0
D Done BDEBUGGER: add cmdline option to set a breakpoint at a given line Suggestions 0
D Done TCEdit and BDEBUGGER: add cmdline switch to jump to given line Suggestions 2
R Done Add "Evaluate Expression" to Right-Click Context Menu in Batch Debugger Suggestions 3
S Add support for Git auto-completion Suggestions 0
R Declined wish-list: add a command to copy a file to clipboard. Suggestions 17
R Declined Install option: Add File Explorer Run As Adminstrator option Suggestions 14
Dmitry L. Kobyakov Done Add the possibility to comment the ENDIFF Suggestions 11
Charles Dye Declined Windows functions and command: Add syntax to specify HWND directly Suggestions 0
Charles Dye Done @SNAPSHOT: Add option to capture the entire virtual screen Suggestions 0
R Done Add Libraries and Multi-line In-Memory functions to Features List on Website Suggestions 1
R Done Add to Pause Help text re indenting the prompt Suggestions 0
C Done Add ability for inline image files for sendmail or similar Suggestions 2
WinLanEm Add commands and functions Suggestions 11
rps Declined Add auto-load directives to tcmd.ini Suggestions 3
Joe Caverly Add a "Snippet" Menu to CMDebug and TCC Debugger Suggestions 0
D Done Add the ability to control syntax coloring via an environment variable or some other way Suggestions 3
Joe Caverly Add example .BTM code to TCC Debugger and CMDebug Suggestions 1
Alpengreis Done Add "Slow copy" (/WAIT) parameter to SYNC command Suggestions 1
Charles Dye Done MOUNTISO: Add support for VHD / VHDX files Suggestions 5
A Declined Take Command/Debugger as a Visual Studio 2017 add-in/extension Suggestions 4
rps Declined Add optional parameters to @search Suggestions 4
rps Done Add PDIR switches Suggestions 1
rps Declined ECHO -- Add spacing option Suggestions 2
vefatica Done Add log2 to @EVAL Suggestions 3
rps Done Add exclusion ranges to @files Suggestions 0
D Done Add VIEW option to open in same position as current window Suggestions 0
N Done Add display options to new HASH function Suggestions 1
rconn Add a parameter to dir command to handle zip files as folders Suggestions 1
rconn add support for batch file projects Suggestions 0
rconn Add support for backpipes Suggestions 0
rconn Add option to run programs Elevated from toolbar buttons Suggestions 0
rconn In the Help tab let the user add links either to files or web pages, with an icon & label. Suggestions 0
W Done Add colorize to tree command? Suggestions 0
Phileosophos Done Please add options for scrollback buffer searching Suggestions 24
G Declined Add option to turn on file name case sensitivity Suggestions 6
nickles Done Add a "Mark all threads read" button Suggestions 3
B Done Add New INI Directive To Specify WIPE Default Pass Count Suggestions 0
S Declined Add /W(ipe) option to several commands Suggestions 17
C TC drop-zone to add a tab Suggestions 0
W Done Add an option to control command line parsing Suggestions 7

Similar threads