 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
 |
| Author |
Message |
SMJ
Joined: 10 May 2006 Posts: 113
|
Posted: Thu Feb 01, 2007 5:31 pm Post subject: |
|
|
The generic method is a better solution, because... well... it's generic.
Rather than alter the way the code works, adding an entire list of useless script launchers, why not just either:
- Externalize the code you want to launch, and use functions instead of launching another script?
textcmd.src
| Code: | include "textcmd.inc";
program _TextCmd(who, text)
TextCmd(who,text);
endprogram |
textcmd.inc
| Code: | function TextCmd(byref who, text)
// Do stuff.
endfunction |
MyFunctions.src
| Code: | include "textcmd.inc";
program MyProgram(...)
//...
TextCmd(who,text);
//...
endprogram |
Write your own function so that the parameters are easier for you?
textcmds.inc
| Code: | function LaunchTextCmd(command, byref who, text)
StartScript(command, array{ who, text } );
endfunction
function testTCParms( byref first_parm, byref second_parm )
if( TypeOf(first_parm) == "Array" )
second_parm := first_parm[1];
first_parm := first_parm[2];
endif
endfunction |
Every Text Command
| Code: | include "textcmds.inc";
program TextCmd(who, text)
testTCParms(who,text);
// Do textcmd stuff.
endprogram |
Either way, it'll take a little bit of time; but if it can be done with a script without causing any trouble in performance, it should. |
|
 |
|
|
|