mIRC Home    About    Download    Register    News    Help

Print Thread
Set focus to a window #138189 25/12/05 07:10 PM
Joined: Feb 2003
Posts: 26
M
MRN Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Feb 2003
Posts: 26
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?

Re: Set focus to a window #138190 25/12/05 07:57 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Hard to understand what exactly you want, post your code and maybe we can help.

Re: Set focus to a window #138191 26/12/05 03:25 AM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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)


Gone.
Re: Set focus to a window #138192 27/12/05 04:11 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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.

Re: Set focus to a window #138193 27/12/05 04:27 AM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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.


Gone.
Re: Set focus to a window #138194 28/12/05 01:00 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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!

Re: Set focus to a window #138195 29/12/05 10:23 PM
Joined: Feb 2003
Posts: 26
M
MRN Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Feb 2003
Posts: 26
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