www.ClassicTW.com
https://mail.black-squirrel.com/

TWXProxy Script commenting questions
https://mail.black-squirrel.com/viewtopic.php?f=15&t=34103
Page 1 of 1

Author:  SteveH_66 [ Tue Aug 20, 2013 1:47 pm ]
Post subject:  TWXProxy Script commenting questions

I made a post earlier that wasn't very descriptive in the title or the body, and didn't specify the helper, my appologies. Thought I would just do a new post trying to have a more descriptive title in case a new scripter is doing a search later.

As I said in the previous message, when doing a comment in a TWXProxy script, the # at the beginning of each line is well known and the most used commenting technique out there.

I saw in a script written by someone, I think it was Sing, // used on a line of code to make a comment after the code itself - if I was seeing that right. I would appreciate if someone could confirm that this is correct, or let me know I am mistaken.

I did a search of the forum for multi-line commenting, I thought I had seen a comment spanning multiple lines in a script or script example in the forum somewhere, but I couldn't find it doing a search.

Is it possible to do a multiple line comment in a TWXProxy script with a set of symbols marking the start and end of the comment? If so, was it /* to begin and */ to end? Or is something else used to start and end a multiple line comment? I would appreciate it if someone could confirm this or tell me I am mistaken.

Author:  Crosby [ Tue Aug 20, 2013 3:31 pm ]
Post subject:  Re: TWXProxy Script commenting questions

So let's test it...
Code:
# Test Script
#      Testing various Rem(s)
#                          in twx script
:howdy
echo "** This is test of remarks w/ twx.**"
:test1
# ok, pretty tame so far
echo "** Ok, now for a //...**" //  This is meant to test the // remark theory
:post                           //    This is the second test of the //
# ok, now for  the multi line trial
:multiline
/*  just testing a multi line remark
to see if it works at all or if it will
      end in some sort of failure...*/
     
# ok fin
:Dats_All
echo "That'll about do it for this test"


This gets us this:
Loading and compiling script: C:\TWXProx2.04\scripts\_Working\__RemTesting.ts

Citadel command (?=help)
Script compilation error: Operation syntax error, line 8 (__REMTESTING.TS)


Script terminated: C:\TWXProx2.04\scripts\_Working\__RemTesting.ts


So I change line 8 from this:
Code:
echo "** Ok, now for a //...**" //  This is meant to test the // remark

To this:
Code:
echo "** Ok, now for a //...**" # //  This is meant to test the // remark


Pooh, same result, duplicate error. So now I change line 8 to:
Code:
#echo "** Ok, now for a //...**" //  This is meant to test the // remark


Result?
Script compilation error: Operation syntax error, line 9 (__REMTESTING.TS)
Doh! Doesn't care for that // rem at all...
Ok, so I # out line 9..
Error in line 12.
Ok, that's the /* multiline comment. */

So for my testing, on my version of twx..the only rem I can find is the #.

Author:  SteveH_66 [ Tue Aug 20, 2013 3:38 pm ]
Post subject:  Re: TWXProxy Script commenting questions

Doh! :lol: Thanks Crosby, should have thought about just testing it in a script! Well, maybe there is a way to do the other 2 ways of commenting and I just misread when i did the search. Or maybe # is the only way to comment. Thanks for taking a look at it and running that test :)

Post Edit :

I did an extremely simple script to do a sector display from the command prompt. It appears the inline remark function with // does work, although as I said it is a very simple script so who knows with something longer. Maybe I should test on a bigger script? Here is the test script code :

Code:

# Comments test

:comment1
send "*" // This should do a display of the sector

halt


Author:  ElderProphet [ Fri Aug 23, 2013 10:32 pm ]
Post subject:  Re: TWXProxy Script commenting questions

I added inline comments with the beta of v2.05. I believe all of the beta versions floating around include this, as it was added early.
Begin inline coments with //

There is no multiline comment available at this time.

Regards,
+EP+

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/