Maximum Line Length!

This is a discussion / support forum for the Hugo programming language by Kent Tessman. Hugo is a powerful programming language for making text games / interactive fiction with multimedia support.

Hugo download links: https://www.generalcoffee.com/hugo
Roody Yogurt's Hugo Blog: https://notdeadhugo.blogspot.com
The Hugor interpreter by RealNC: http://ifwiki.org/index.php/Hugor

Moderators: Ice Cream Jonsey, joltcountry

User avatar
Ice Cream Jonsey
Posts: 28925
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Maximum Line Length!

Post 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.
the dark and gritty...Ice Cream Jonsey!

Merk
Posts: 192
Joined: Mon Nov 22, 2004 3:19 pm
Location: Wichita, KS
Contact:

Post by Merk »

The length of the input line? I'm not sure which line you mean.

pinbacker
Posts: 317
Joined: Mon Jul 23, 2007 11:03 am
Location: The Sun!

Post by pinbacker »

Yeah, Jones, what the fuck are you talking about?
That's the wrong video, by the way.

User avatar
Ice Cream Jonsey
Posts: 28925
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Post 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.
the dark and gritty...Ice Cream Jonsey!

Merk
Posts: 192
Joined: Mon Nov 22, 2004 3:19 pm
Location: Wichita, KS
Contact:

Post by Merk »

Ooooooh. Hmmmm. That's one for Kent.

Kent
Posts: 119
Joined: Fri Jun 27, 2003 12:10 pm

Post 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.

User avatar
Ice Cream Jonsey
Posts: 28925
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Post 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.
the dark and gritty...Ice Cream Jonsey!

User avatar
Ice Cream Jonsey
Posts: 28925
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Post 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.
the dark and gritty...Ice Cream Jonsey!

bruce
Posts: 2544
Joined: Tue Jun 04, 2002 10:43 pm

Post 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

User avatar
Ice Cream Jonsey
Posts: 28925
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Post 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.
the dark and gritty...Ice Cream Jonsey!

pinbacker
Posts: 317
Joined: Mon Jul 23, 2007 11:03 am
Location: The Sun!

Post by pinbacker »

sizeof(penis) == HUGE

ha ha i'm like bruce and knuckles except dumber than one and smarter than tha other
That's the wrong video, by the way.

User avatar
Ice Cream Jonsey
Posts: 28925
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Post 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.
the dark and gritty...Ice Cream Jonsey!

pinbacker
Posts: 317
Joined: Mon Jul 23, 2007 11:03 am
Location: The Sun!

Post by pinbacker »

I don't...

...but I know someone who does!

That should at least make me comatose to you!
That's the wrong video, by the way.

bruce
Posts: 2544
Joined: Tue Jun 04, 2002 10:43 pm

Post 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

User avatar
Ice Cream Jonsey
Posts: 28925
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Post by Ice Cream Jonsey »

Maybe I should just go in with a hex editor and change my copy of the compiler executable.
the dark and gritty...Ice Cream Jonsey!

Kent
Posts: 119
Joined: Fri Jun 27, 2003 12:10 pm

Post 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.

User avatar
Ice Cream Jonsey
Posts: 28925
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Post 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!
the dark and gritty...Ice Cream Jonsey!

bruce
Posts: 2544
Joined: Tue Jun 04, 2002 10:43 pm

Post 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

Vitriola

Post by Vitriola »

But NEVER on Thanksgiving.

bruce
Posts: 2544
Joined: Tue Jun 04, 2002 10:43 pm

Post by bruce »

Vitriola wrote:But NEVER on Thanksgiving.
Why not? All the coats are on the bed.

Bruce

Post Reply