mIRC Homepage
Posted By: MRN Set focus to a window - 25/12/05 07:10 PM
I have a @window which I made a menu for, which stats an alias. To problem is that this alias is under debugging, and I use much echo -s and var -s. In this @window, I sort results (/window -s) and later uses the results.

The problem is that all the debug messages appears in this window, where I start the alias.

A soution could be to set focus, active another window or switch window. The best would be to set focus to Status Window. How?

I tried //var -s %a $window(*status*,1) | window -a %a, but that didn't work. //var -s %a $window(*,1) | window -a %a happened to be the same window the window I wanted to avoid. Besides, that would screw up other windows.

Any suggestions?
Posted By: MikeChat Re: Set focus to a window - 25/12/05 07:57 PM
Hard to understand what exactly you want, post your code and maybe we can help.
Posted By: FiberOPtics Re: Set focus to a window - 26/12/05 03:25 AM
The solution is simple.

Remove the s switch from the var command, and use /echo -s -> %var, which will echo the value of the variable to your status window, instead of showing it in your custom window. What you are experiencing is perfectly natural, as the -s switch will echo it to the active window where you initiated the code from.

I mean, look at what you are asking, it would be incredibly silly to change the active window so that your var -s would be echoed to the status window, when you could just use echo -s, which is designed to echo something to the status window, not the active window (unless the active window is the status window of course)
Posted By: DaveC Re: Set focus to a window - 27/12/05 04:11 AM
pffffft to everyone else, I wouldnt add a bunch of /ECHO -s, if i can just get away with adding a -s to VAR

Anyway, all yuou need to do is at the start oif the alias or where ever (during testing) add ///WINDOW -a "status window"

PS: i put three /// not becuase there needed, but becuase it make it easier to sweep your code looking for any commands you know yuou want to pull out before you finish with it.
Posted By: FiberOPtics Re: Set focus to a window - 27/12/05 04:27 AM
Then he'll be back saying his "echo -a" doesnt display in his custom window anymore but in the status window, and ask how he can set focus to his custom window <snicker snicker>

Regardless, this was a weird request to say the least... just seems silly alltogether.
Posted By: DaveC Re: Set focus to a window - 28/12/05 01:00 AM
Quote:
Then he'll be back saying his "echo -a" doesnt display in his custom window anymore but in the status window


mahahahaha your very likely right!
Posted By: MRN Re: Set focus to a window - 29/12/05 10:23 PM
Quote:
Then he'll be back saying his "echo -a" doesnt display in his custom window anymore but in the status window, and ask how he can set focus to his custom window <snicker snicker>

That would be easier. Simply //echo @window.

The /window -a "status window" actually worked. The "'s is important.

Thanks for the answer, and for some funny replies in this thread smile
© mIRC Discussion Forums