Additional constants/variables/symbols (your usage may be inconsistent) a la ($SCRIPT_REPOS_DIR), ($SYNTAX_DIR), etc

This is not a problem report or even a request for any specific feature. I’m just curious:

(Before continuing, is there any semantic distinctions between “constants”, “variables”, and “symbols”?)

The reference manual describes several special symbols that are associated with where 010 Editor stores certain types of files. The ones I’m aware of (probably not an exhaustive list)

  • ($BASEDIR)(called a “constant”)
  • ($SCRIPTDIR)(called a “variable”)
  • ($TEMPLATEDIR)(called a “variable”)
  • ($SCRIPT_REPOS_DIR)(called a “constant”)
  • ($TEMPLATE_REPOS_DIR)(called a “constant”)
  • ($SYNTAX_DIR)(called a “constant”)
  • ($SYNTAX_DLL_DIR)(called a “constant”)
  • ($PROGDIR)(called a “symbol”)

I see that ($TEMPLATE_REPOS_DIR)is used below:

I haven’t needed to use any of them so far, but($TEMPLATE_REPOS_DIR)looks interesting

So a Template’s Options settings can specify an alternate repository by using a string other than ($TEMPLATE_REPOS_DIR) in the File Name field? I wonder if there might be un-obvious implications of doing so? (I can always try it, I guess!)

It seems apparent that scripts and ($SCRIPT_REPOS_DIR)and syntaxes and their associated constants would behave analogously.

Have you thought about implementing something analogous for projects/workspaces, or about a more general-purpose scheme to allow users to define and use their own symbols?

For naming, $PROGDIR and $BASEDIR are fixed when 010 Editor starts so they should probably be called ‘Constants’. The other symbols can be changed using the ‘Directories’ page of the Options dialog, so they should probably be called ‘Variables’. We’ll try to update our manual to be consistent. These variables are useful if you wanted to move all your templates to a different directory then you could just update the ‘Template Directory’ entry on the ‘Directories’ page and you then you wouldn’t have to modify any of the file names that use the ($TEMPLATEDIR) constant.

By the way, the same syntax can be used to access any environment variables on your machine. For example, if you have an environment variable USERDIR then you can use ($USERDIR) in any file name in the Options dialog. There aren’t any built-in variables for use with projects, but we could add in some in the future.

Graeme
SweetScape Software