Author Topic: Build window  (Read 7843 times)

slicker

  • Community Member
  • Posts: 12
  • Hero Points: 0
Build window
« on: July 23, 2007, 02:24:41 pm »
Aka. Concurrent Process Buffer.

How can I re-spawn the process every time I open a project workspace? The purpose of this is to "clear" all the environment variables that I set in the previous project/workspace, just like opening a new command prompt window if you like.

Thank you very much.

hs2

  • Senior Community Member
  • Posts: 2732
  • Hero Points: 284
Re: Build window
« Reply #1 on: July 23, 2007, 02:34:43 pm »
You could use macro command this as Project Open command (Project->Project Properties>Open tab).
Code: [Select]
_command void respawnprocess ()
{
   exit_process ();
   clear_pbuffer();
   start_process();
}

Edit: It should be possible to just add these 3 lines as Project Open commands:

Code: [Select]
   exit-process
   clear-pbuffer
   start-process

HS2
« Last Edit: July 23, 2007, 02:37:13 pm by hs2 »

slicker

  • Community Member
  • Posts: 12
  • Hero Points: 0
Re: Build window
« Reply #2 on: July 23, 2007, 02:38:17 pm »
Sorry HS2, I'm completely useless on macro, never done this before. Can you tell me how (and where) do I go about adding these lines? thanks in advance.

slicker

  • Community Member
  • Posts: 12
  • Hero Points: 0
Re: Build window
« Reply #3 on: July 23, 2007, 02:41:13 pm »
Are these method only apply to one project? if not, how can I make it apply to all?

hs2

  • Senior Community Member
  • Posts: 2732
  • Hero Points: 284
Re: Build window
« Reply #4 on: July 23, 2007, 02:45:41 pm »
I afraid you've to add the (project specific) commands to each project.
HS2

slicker

  • Community Member
  • Posts: 12
  • Hero Points: 0
Re: Build window
« Reply #5 on: July 23, 2007, 02:49:39 pm »
there is no other way?!?
 :o
I always think we should start a new process every time we start a new project. Is there a reason we should re-use the same process? Enlighten me please :)
« Last Edit: July 23, 2007, 03:06:38 pm by slicker »

hs2

  • Senior Community Member
  • Posts: 2732
  • Hero Points: 284
Re: Build window
« Reply #6 on: July 23, 2007, 05:46:53 pm »
Of course there is another way - it's SlickEdit ;)
Why do one need to always start a process buffer when switching projects ?
BTW do you mean projects or workspaces ?
Env.vars. can be set per workspace (global for all contained projects).
You can also set env.vars per project build tool (running in process buffer).
Since switching workspaces or projects is very fast in SlickEdit, you can find a proper structure of your 'real' project e.g. one project/workspace or all projects in one workspace, ... which meets your requirements.

However, if you you really need a fresh process buffer each time you switch workspaces or projects you can achieve with little macro help. I could send/post an example if you want, but I don't favor this method as long as there is a standard way of getting things done.

HS2

Phil Barila

  • Senior Community Member
  • Posts: 746
  • Hero Points: 61
Re: Build window
« Reply #7 on: July 23, 2007, 06:13:45 pm »
How can I re-spawn the process every time I open a project workspace? The purpose of this is to "clear" all the environment variables that I set in the previous project/workspace, just like opening a new command prompt window if you like.
Have you tried the brute-force approach?  Type "exit" (without the quotes) in the build window, then Ctrl + Shift+ M to open it again.

slicker

  • Community Member
  • Posts: 12
  • Hero Points: 0
Re: Build window
« Reply #8 on: July 24, 2007, 11:01:48 am »
Why do one need to always start a process buffer when switching projects ?
Because like I explained earlier, the window "remembers" all the env var I set in the previous workspace.

BTW do you mean projects or workspaces ?
Workspace. Sorry I should have made it more precise.

Env.vars. can be set per workspace (global for all contained projects).
You can also set env.vars per project build tool (running in process buffer).
The way we build our software involves running a .bat file to setup the env var, then execute make to build. Therefore one can choose to build the software without opening the editor. Also, there are loads of existing projects needs to be converted if we were to follow your method above. So the method is not ideal.

I hope I have given you the reason why we should start a new process every time we open a workspace. I think MS VS 2005 does it too. By no mean I suggest they are the standard. I'm only suggesting there are people who are agree with me.

I would be happy to receive the macro example from you, thanks a lot!! :)

slicker

  • Community Member
  • Posts: 12
  • Hero Points: 0
Re: Build window
« Reply #9 on: July 24, 2007, 11:06:59 am »
How can I re-spawn the process every time I open a project workspace? The purpose of this is to "clear" all the environment variables that I set in the previous project/workspace, just like opening a new command prompt window if you like.
Have you tried the brute-force approach?  Type "exit" (without the quotes) in the build window, then Ctrl + Shift+ M to open it again.

Hi Phil,

This method works, thanks! but in a team work environment, we need more automation and less manual work, because any extra steps added will only increase the chance of making mistake. Thanks anyway.  :)

hs2

  • Senior Community Member
  • Posts: 2732
  • Hero Points: 284
Re: Build window
« Reply #10 on: July 24, 2007, 11:42:03 am »
Here we go ...
I tried to put some useful comments in it. I hope it's 'human readable' ;)
Note that there is a 'Slick-C Macro Programming Guide' section in the help.
But don't hesitate to use the great forum or send me a msg.

Good luck,
HS2
« Last Edit: July 24, 2007, 11:44:48 am by hs2 »

slicker

  • Community Member
  • Posts: 12
  • Hero Points: 0
Re: Build window
« Reply #11 on: July 24, 2007, 12:09:43 pm »
HS2 you have been helpful. Thanks ever so much..  ;)

Really hope to see this feature will get into the next release, as I can't see the reason for retaining the process across workspace.

hs2

  • Senior Community Member
  • Posts: 2732
  • Hero Points: 284
Re: Build window
« Reply #12 on: July 24, 2007, 04:13:05 pm »
Well, one reason (maybe besides others) is that stopping and restarting the shell takes it's time and this slows down workspace switching speed.
I'd disable that 'feature' if it appears in future versions ;)

HS2

chip.dip

  • Community Member
  • Posts: 18
  • Hero Points: 1
Re: Build window
« Reply #13 on: July 24, 2007, 07:56:41 pm »
Another way to undo environment variable changes is to run you .bat file in a nested instance of the shell:

   "cmd.exe xx.bat"

the new instance of the shell keeps its own copy of the environment.

slicker

  • Community Member
  • Posts: 12
  • Hero Points: 0
Re: Build window
« Reply #14 on: August 16, 2007, 09:33:36 am »
I'd disable that 'feature' if it appears in future versions ;)

Exactly. we should be given the choice! A tickbox is all we need... :)
« Last Edit: August 16, 2007, 09:35:19 am by slicker »