Maximum line length?
Having spent ages debugging why on earth my global variable was not working, I moved the comment in main.c on the same line as the make_global_int() to the next line down.
Tada! It works.
But why? Is there a max line length I don't know about? The total length was 129 chars. It works just fine with a shorter comment, so it's not the fact that it's on the same line that's the problem.
FreeDink version Idontknowprobablyquiteold
Tada! It works.
But why? Is there a max line length I don't know about? The total length was 129 chars. It works just fine with a shorter comment, so it's not the fact that it's on the same line that's the problem.
FreeDink version Idontknowprobablyquiteold
Comments on the same line of code have been known to make the code fail, I think I read that in the DinkC Ref somewheres... or maybe it was just a dream...
Perhaps it was both. This is an excerpt from BigTed's annotated Dinkc.txt:
*** BE CAREFUL WITH YOUR COMMENTS ***
Comment like this:
int &crap = 5;
//sets this to 5, duh
Not like this:
int &crap = 5; //sets this to 5, duh
This could cause a problem, some commands use 'does this char exist in this
string?' procedures. Don't do it. [I think he means his parser considers
a line at a time and searches the entire line for text. If so, why doesn't
it internally truncate the line at a "//"? That's what it's for!!
And anyway, Seth is not above violating this rule in his own code -- see
the entry for sp_nocontrol() in part 2.]
Having a brief look at the line parser suggests that a comment is only truly considered a comment if it's on its own line.
*** BE CAREFUL WITH YOUR COMMENTS ***
Comment like this:
int &crap = 5;
//sets this to 5, duh
Not like this:
int &crap = 5; //sets this to 5, duh
This could cause a problem, some commands use 'does this char exist in this
string?' procedures. Don't do it. [I think he means his parser considers
a line at a time and searches the entire line for text. If so, why doesn't
it internally truncate the line at a "//"? That's what it's for!!
And anyway, Seth is not above violating this rule in his own code -- see
the entry for sp_nocontrol() in part 2.]
Having a brief look at the line parser suggests that a comment is only truly considered a comment if it's on its own line.
I'm sure there used to be a maximum character limit per line, even for comments. It wasn't much either, something around 200 if I had to try to remember.
However, it seems like whatever version of Freedink I'm using (probably the latest one, whatever that is it's years old at this point anyway) got rid of that limit. THIS SHIT never would have flown in v1.08 or earlier!
And yeah, comments after commands have never worked properly. I think it doesn't work more often than it does. Seth is a sadist, so he made it so that DinkC doesn't support it but still sometimes used it in his scripts.
However, it seems like whatever version of Freedink I'm using (probably the latest one, whatever that is it's years old at this point anyway) got rid of that limit. THIS SHIT never would have flown in v1.08 or earlier!
And yeah, comments after commands have never worked properly. I think it doesn't work more often than it does. Seth is a sadist, so he made it so that DinkC doesn't support it but still sometimes used it in his scripts.
Looking around the DinkHD source code, it seems that line buffers are 200 characters max. See line 3702: https://github.com/drone1400/RTDink/blob/master/source/dink/dink.cpp
Although, further down there's another line buffer that's 512 characters, and then another one that's 300 characters, hah
Although, further down there's another line buffer that's 512 characters, and then another one that's 300 characters, hah