|
|
Joined: Apr 2003
Posts: 20
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2003
Posts: 20 |
I don't get it, what's the point of signals? Why use them?
|
|
|
|
Joined: Dec 2002
Posts: 1,527
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,527 |
well i can think of a bunch of different uses for signals . ive seen a pretty indepth version changer that uses signals its done without any dll at all and works .... also there are several reasons that u may need to use signals to trigger a specific script event your your trying to run ...... its pretty uch like asking why have an onjoin event... each one has its purpose
D3m0nnet.com
|
|
|
|
Joined: Dec 2002
Posts: 5,426
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 5,426 |
One advantage over aliases is that you can have multiple loaded scripts all listening for a specific signal, and when that signal is set, it triggers in all of these scripts. So it could be used as a way of co-ordinating multiple independent scripts.
In the end though, signals are just another tool, and it's hard to say where they might or might not be useful. It all depends on whether you come across a situation where signals might serve as a more elegant solution to a scripting problem, which could just as easily be solved in other ways!
|
|
|
|
Joined: Feb 2003
Posts: 2,812
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 2,812 |
One nice thing about Signals, is it's similar properties to Timers, only slightly better. You can call a signal with /signal -n and have it execute things in the middle of your proccess (much like calling an alias as you usually would), except that the signal you call can halt or cause an error, and the original script wont die from it.
I've seen some nifty error trapping scripts come of this.
Well. At least I won lunch. Good philosophy, see good in bad, I like!
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,922 |
Sorry, I didn't get your point.
A script, generally speaking, shouldn't cause an error. It must have proper error checking, and never show an "invalid parameters" message.
Also, if you call an alias, it can use /return for halting self and continuing in the main process (unlike /halt that stops the main process as well).
|
|
|
|
Joined: Feb 2003
Posts: 2,812
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 2,812 |
Well, in some advanced scripting where you're relying on user input and perform syntex checking on their input, error trapping could be of great use to inform the user of an error they made and requesting the information again. Under normal circumstances, the script would die and no script-specific user prompt would be provided.
Example. "Script caused a Divide-By-Zero, please enter different parameters."
Well. At least I won lunch. Good philosophy, see good in bad, I like!
|
|
|
|
|
|