User forums > Help
$workspace_name built-in variable?
fabrizio.benedetti:
I need a $workspace_name variable... is there a built-in variable providing the workspace name (as there is a $project_name variable)? If not, is there anything I can do to work around it?
Ciao!
Fabrizio
fabrizio.benedetti:
Is it possible to register a script that C::B would execute on loading a Workspace? And, can the script get the workspace name and set a variable?
...or:
can I use script expansion where I need to obtain the Workspace name? [[ print(GetProjectManager().GetWorkspace().GetTitle()); ]] (but seems that no method exists to obtain the title of the current workspace)
fabrizio.benedetti:
I added the following built-in macros:
WORKSPACE_FILE, WORKSPACE_FILENAME, WORKSPACE_FILE_NAME, WORKSPACEFILE, WORKSPACEFILENAME
WORKSPACENAME, WORKSPACE_NAME
WORKSPACE_DIR, WORKSPACE_DIRECTORY, WORKSPACEDIR, WORKSPACEDIRECTORY
The attached patch shows my changes.
Ciao!
Fabrizio
[attachment deleted by admin]
killerbot:
though I haven't looked at the path (yet) sounds interesting, I would suggest to have jut one name for each variable, just like the other ones in CB, using the same style.
fabrizio.benedetti:
--- Quote from: killerbot on July 16, 2008, 05:08:50 pm ---I would suggest to have jut one name for each variable, just like the other ones in CB, using the same style.
--- End quote ---
Actually, I dubbed the CB style for the project variables, which are provided in a number of variations (MacrosManager::RecalcVars()):
PROJECT_FILE, PROJECT_FILENAME, PROJECT_FILE_NAME, PROJECTFILE, PROJECTFILENAME
PROJECTNAME, PROJECT_NAME
PROJECT_DIR, PROJECT_DIRECTORY, PROJECTDIR, PROJECTDIRECTORY
PROJECT_TOPDIR, PROJECT_TOPDIRECTORY, PROJECTTOPDIR, PROJECTTOPDIRECTORY
Maybe these could be reduced to just one name too.
Ciao!
Fabrizio
Navigation
[0] Message Index
[#] Next page
Go to full version