Author Topic: Proper Code Format for Script Combiner  (Read 2034 times)

0 Members and 1 Guest are viewing this topic.

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Proper Code Format for Script Combiner
« on: June 10, 2007, 10:41:18 pm »
For those of you releasing codes please follow these guidelines so those who use my script combiner can also use your code with it.

The full procedure/function line
The var statement if necessary, followed by the variables
The begin statement followed by the main code
The end; statement

For the built-in functions that have a return statement, only include a return statement if you are changing it's value in your script.

The only comments that will not get stripped out are single line comments using '//' in the begin section of a procedure
Lastly, comment type syntax cannot be used in strings. (myString := '//hello') Comments count as: //comment, (* comment *), and { comment }
« Last Edit: June 11, 2007, 11:36:13 am by mikembm »

Offline deguix

  • Major
  • *
  • Posts: 79
Re: Proper Code Format for Script Combiner
« Reply #1 on: June 11, 2007, 01:31:45 am »
Well... where's it btw? No links here. :(

(Shouldn't this go to the "How to properly combine scripts" topic in the Scripting Discussions and Help forum?)

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Proper Code Format for Script Combiner
« Reply #2 on: June 11, 2007, 01:33:50 am »
Yup doesn't belong in this forum. I think hes trying to get a sticky... but no.



LOOKING FOR THE WORD SUPERNATURAL COMB ? WELL ITS GONE! ALL YOUR HINT ARE BELONG TO ME!

Offline chrisgbk

  • Moderator
  • Veteran
  • *****
  • Posts: 1739
Re: Proper Code Format for Script Combiner
« Reply #3 on: June 11, 2007, 02:43:04 am »

For functions that have a return statement in the template, do not include that as part of your code.

This is asking too much; those lines are needed, and not everyone is going to use the script combiner. Either fix the script combiner, or add a note so people can manually fix scripts as needed.

Remember, some scripts may modify the return value; leaving it out in that case will not result in the desired behaviour.

Unless there is a good reason not to, I'm going to end up merging this with the other thread; tools of the community should not dictate formatting of others work without good reason, of which working around problems with a tool is not one of those reasons.
« Last Edit: June 11, 2007, 02:48:21 am by chrisgbk »

Offline spkka

  • Camper
  • ***
  • Posts: 469
Re: Proper Code Format for Script Combiner
« Reply #4 on: June 11, 2007, 05:29:59 am »
agreed, i really like the idea but it should work for all scripts... Mine bugged when i tried combining something so i didn´t :(

fix the code a lot of new scripters will like the combiner i think..
cheers spkka
« Last Edit: June 11, 2007, 05:31:58 am by spkka »

Offline FliesLikeABrick

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 6144
    • Ultimate 13 Soldat
Re: Proper Code Format for Script Combiner
« Reply #5 on: June 11, 2007, 06:30:28 am »
This information really should have been posted in the script combiner thread, not a separate one.

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Proper Code Format for Script Combiner
« Reply #6 on: June 11, 2007, 11:25:29 am »

For functions that have a return statement in the template, do not include that as part of your code.

This is asking too much; those lines are needed, and not everyone is going to use the script combiner. Either fix the script combiner, or add a note so people can manually fix scripts as needed.

Remember, some scripts may modify the return value; leaving it out in that case will not result in the desired behaviour.

Unless there is a good reason not to, I'm going to end up merging this with the other thread; tools of the community should not dictate formatting of others work without good reason, of which working around problems with a tool is not one of those reasons.

No you misunderstood. When you download the server and get the default code all the functions have a return line in them like Result := State or whatever. And I have seen some people include those in their script. But if you do that it will just double up on that line. You can of cource include wahtever return statements you want. I'm just saying dont include the ones that are already there to begin with.

Offline chrisgbk

  • Moderator
  • Veteran
  • *****
  • Posts: 1739
Re: Proper Code Format for Script Combiner
« Reply #7 on: June 11, 2007, 05:58:22 pm »

For functions that have a return statement in the template, do not include that as part of your code.

This is asking too much; those lines are needed, and not everyone is going to use the script combiner. Either fix the script combiner, or add a note so people can manually fix scripts as needed.

Remember, some scripts may modify the return value; leaving it out in that case will not result in the desired behaviour.

Unless there is a good reason not to, I'm going to end up merging this with the other thread; tools of the community should not dictate formatting of others work without good reason, of which working around problems with a tool is not one of those reasons.

No you misunderstood. When you download the server and get the default code all the functions have a return line in them like Result := State or whatever. And I have seen some people include those in their script. But if you do that it will just double up on that line. You can of cource include wahtever return statements you want. I'm just saying dont include the ones that are already there to begin with.

The point still stands, that someone who does it manually would then be left in the dark. The entire working script should always be included, not segments that work if you use a certain tool to combine them.