Author Topic: workspace directory macro  (Read 5702 times)

PlanetPratt

  • Senior Community Member
  • Posts: 145
  • Hero Points: 6
workspace directory macro
« on: July 26, 2008, 04:43:19 am »
Is there a macro variable (or a macro) that contains either the workspace directory or the project directory (or possibly the configured source directory) in Eclipse?  Thanks.
  (*Chris*)

hs2

  • Senior Community Member
  • Posts: 2737
  • Hero Points: 288
Re: workspace directory macro
« Reply #1 on: July 26, 2008, 08:48:02 am »
Dunno if it's available in Eclipse too, but in SE I'm using this (as example):
Code: [Select]
_command void cdp () name_info(',' VSARG2_REQUIRES_MDI_EDITORCTL|VSARG2_READ_ONLY|VSARG2_ICON)
{
   _str cwd=_ProjectGet_WorkingDir (_ProjectHandle (_project_name));

   if ( cwd != '' )
   {
      cwd=absolute (cwd,strip_filename (_project_name,'N'));
      // say ( "cdp (): Change directory '" getcwd () " -> '" cwd "'" );
      cd ('+p 'cwd);
      // added to sync with 'Open TB'
      _cd_tbopen ();
   }
}
HS2