Page 1 of 2

Maximum Line Length!

Posted: Mon Oct 01, 2007 9:35 am
by Ice Cream Jonsey
SAY, just to confirm, there is no way to increase the maximum line length in Hugo, is there? I have an array filled with character objects and like 80 characters. So putting them in that array has me running out of space. I guess I could change their names from, "TheBeastofTandorHill" to "BTH1" and such, which is the way I'm handling it now. But I am curious if this is a variable I can set, like MAXROUTINES.

Posted: Mon Oct 01, 2007 6:50 pm
by Merk
The length of the input line? I'm not sure which line you mean.

Posted: Mon Oct 01, 2007 6:53 pm
by pinbacker
Yeah, Jones, what the fuck are you talking about?

Posted: Mon Oct 01, 2007 7:11 pm
by Ice Cream Jonsey
Merk wrote:The length of the input line? I'm not sure which line you mean.
Oh - I mean the line as in any given line in the source code.

For instance, you seem to get about a thousand characters. You can wrap it using \ (or is it the "/" character, I can never remember) but eventually you come across the limit of how many characters can exist in one Hugo expression.

Posted: Mon Oct 01, 2007 7:15 pm
by Merk
Ooooooh. Hmmmm. That's one for Kent.

Posted: Tue Oct 02, 2007 2:51 pm
by Kent
If I understand you correctly and recall the compiler source (without actually, you know, looking at it), I think there's a 1024-character input buffer used for reading source code line-by-line, and it'll bark at you if you go beyond that.

I'm not sure exactly what you're up to. Is there a way to work around this? It's certainly possible source-code wise to push that limit up, seeing as it's basically been around since the beginning, and machines have things like lots of memory now.

Posted: Tue Oct 02, 2007 3:47 pm
by Ice Cream Jonsey
Kent wrote:If I understand you correctly and recall the compiler source (without actually, you know, looking at it), I think there's a 1024-character input buffer used for reading source code line-by-line, and it'll bark at you if you go beyond that.
Ah, right right - 1024 would be what I encountered.

I'm not sure exactly what you're up to. Is there a way to work around this? It's certainly possible source-code wise to push that limit up, seeing as it's basically been around since the beginning, and machines have things like lots of memory now.
When you say source code, do you mean mine or the Hugo compiler's source? I just did a scan on the Hugo source for 1024 and the following line comes up:

if (list_buffer = malloc(1024*sizeof(char)))

If that's what I'd need to change, I think I could recompile the source and then use that to compile my WIP. But if it's just a matter of changing something like MAXLINELENGTH in my game's source code, I can of course do that as well (I just don't know what the variable name is) (for instance, it's MAXROUTINES to change the maximum number of routines).

As for the specific example, I'm just making an array of objects. Like:

array[80] = "VernonWells", "AlexRios", "TroyGlaus" and so forth. I already give each object a "character identification number" so I could just use that instead of their names. Or make their object names something like VW and AR and TG, I suppose.

If the constraint is in the Hugo compiler and you happen to remember off the top of your head where it is set, I'll change it and recompile hc.exe and see what happens. It would definitely be convenient to have longer line lengths.

Posted: Tue Oct 02, 2007 3:50 pm
by Ice Cream Jonsey
Ahhh, I see from the source that it is built with Visual Studio .NET. Not 100% certain if I have that around or not.

Posted: Tue Oct 02, 2007 8:14 pm
by bruce
Also, if Visual Studio .NET is a C compiler--and I don't know that it is, maybe it's C# or something--is it?--anyway, sizeof(char) is 1 by definition in C.

Bruce

Posted: Tue Oct 02, 2007 9:18 pm
by Ice Cream Jonsey
bruce wrote:Also, if Visual Studio .NET is a C compiler--and I don't know that it is, maybe it's C# or something--is it?--anyway, sizeof(char) is 1 by definition in C.

Bruce
That would lead me to believe that I did in fact find the right line.

Posted: Tue Oct 02, 2007 9:51 pm
by pinbacker
sizeof(penis) == HUGE

ha ha i'm like bruce and knuckles except dumber than one and smarter than tha other

Posted: Tue Oct 02, 2007 10:37 pm
by Ice Cream Jonsey
pinbacker wrote:sizeof(penis) == HUGE

ha ha i'm like bruce and knuckles except dumber than one and smarter than tha other
Do you have a .NET compiler on one of your computers? If not you're dead to me and it's over.

Posted: Wed Oct 03, 2007 6:25 am
by pinbacker
I don't...

...but I know someone who does!

That should at least make me comatose to you!

Posted: Wed Oct 03, 2007 11:55 am
by bruce
pinbacker wrote:I don't...
...but I know someone who does!
That should at least make me comatose to you!
It's like talking to Zippy the Pinhead.

Can't you get the Express Edition of the Visual Studio tools for free, just by downloading them from Microsoft?

Bruce

Posted: Wed Oct 03, 2007 12:29 pm
by Ice Cream Jonsey
Maybe I should just go in with a hex editor and change my copy of the compiler executable.

Posted: Wed Oct 03, 2007 4:28 pm
by Kent
I hard-coded that as "1024"? Excellent work. There should be a MAXBUFFER #define in hcheader.h. Since I didn't use that for that allocation, I'll have to look at it in more detail to be sure what, exactly, I was doing.

The other thing you should be able to do in the meantime is, in multiple lines:

MyArray[0] = "A", "B", "C"

MyArray[3] = "D", "E", "F"

MyArray[6] = "G", "H", "I"

and so on.

The Hugo compiler is pretty digestible C. For the Win32 version, the Windows-specific stuff (hcwin.h) uses MS extensions for path-splitting and whatnot. The 32-bit DOS version is compiled with gcc. But if your only compiler is MS QuickC, luckily the 16-bit DOS source has your name on it.

Posted: Wed Oct 03, 2007 5:18 pm
by Ice Cream Jonsey
Kent wrote:I hard-coded that as "1024"? Excellent work. There should be a MAXBUFFER #define in hcheader.h. Since I didn't use that for that allocation, I'll have to look at it in more detail to be sure what, exactly, I was doing.
Ah, no prob. Taking a look, I do see MAXBUFFER in use. My scan just now did not seem to show me where it was defined, so it is possible/probable that I missed it.

And it warrants mentioning that I still like Hugo very, very much and see myself using it in the future because it's just so awesome. I know you know that the stuff Merk and I are finding are corner case things, uncovered because we're both entering our second half-decade of getting good at the language. But I feel bad only really posting to this base when I find something behaving a little odd.

Not related to any of that, I saw this in the source right now:

Code: Select all

	/* Hugo circa v2.2 allowed '^' and '~' for '\n' and '"',
	   respectively
	*/
I didn't know that. I'm glad it doesn't allow it these days. That always bugged me about Inform.

The other thing you should be able to do in the meantime is, in multiple lines:

MyArray[0] = "A", "B", "C"

MyArray[3] = "D", "E", "F"

MyArray[6] = "G", "H", "I"

and so on.
Ah! That would seem to also solve the issue. The "furBearingTrout" object is back in business, baby!

Posted: Wed Oct 03, 2007 7:13 pm
by bruce
Ice Cream Jonsey wrote: The "furBearingTrout" object is back in business, baby!
That sounds dirty. Maybe Vitriola should cut down on your Viagra/Cialis/Prozac ration.

Bruce

Posted: Wed Oct 03, 2007 7:19 pm
by Vitriola
But NEVER on Thanksgiving.

Posted: Wed Oct 03, 2007 10:10 pm
by bruce
Vitriola wrote:But NEVER on Thanksgiving.
Why not? All the coats are on the bed.

Bruce