ID:1912405
 
Problem description:
I'd be glad to know if there's any way of doing something like the following:

Code:
world << output("Test Message","combatwindow;chatwindow;trainingwindow;rpwindow;guildwindow;whisperwindow")


Instead of writing that:
world << output("Test Message","combatwindow")
world << output("Test Message","chatwindow")
world << output("Test Message","trainingwindow")
world << output("Test Message","rpwindow")
world << output("Test Message","guildwindow")
world << output("Test Message","whisperwindow")


Thanks in advance for advice (:
I'm not aware of any built-in syntax for specifying multiple outputs.

A simple for() loop would do it:
proc/output_to_all_windows(Target, Message)
var global/all_outputs[] = list(
"combatwindow",
"chatwindow",
"trainingwindow",
"rpwindow",
"guildwindow",
"whisperwindow")
for(var/out in all_outputs)
Target << output(Message, out)
output_to_all_windows(world, "Test Message")

Or you could just...
proc/output_to_all_windows(Target, Message)
Target << output(Message, "combatwindow")
Target << output(Message, "chatwindow")
Target << output(Message, "trainingwindow")
Target << output(Message, "rpwindow")
Target << output(Message, "guildwindow")
Target << output(Message, "whisperwindow")
I did use the second option you wrote since before writing this post, but I was still wondering whether there's a way to do it like that, instead..
I don't think there is a way to combine controls for output. However, if you're just looking to not repeat code:

var/list/output_windows=list("combatwindow", "chatwindow", "trainingwindow", "rpwindow", "guildwindow", "whisperwindow")
for(var/a in output_windows)
world << output("Test Message", a)


or

var/list/output_windows=list("combatwindow", "chatwindow", "trainingwindow", "rpwindow", "guildwindow", "whisperwindow")
for(var/i=1, i<=output_windows.len, i++)
world << output("Test Message", output_windows[i])


EDIT: Kaio so fast. =O
The big question: Why do you need to send the exact same message to more than one window? If you want to have output always available in whatever window you're looking at, the easier way to do this is for your output to reside alone in its own pane, and to move that pane to whatever window is active.
Lummox, I want every special message (e.g Login, Event, AFK Check, etc) to show in all of the tabs, so no one will be able to miss it (there are separate chat-tabs for each info-type)
Either way, thanks :) I didn't know I could use a list for that purpose
output() is super slow. This is the kind of thing you should probably delegate to javascript.
In response to DOLEVBARON
That sounds like a design flaw. Chances are you don't need the output control to be inside the tab; you could simply move it outside. If it's in a different position in each tab, you still can make this work via an on-tab command (albeit a complex one).