Maximum Line Length!
Moderators: Ice Cream Jonsey, joltcountry
- Ice Cream Jonsey
- Posts: 30191
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
Maximum Line Length!
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!
-
- Posts: 192
- Joined: Mon Nov 22, 2004 3:19 pm
- Location: Wichita, KS
- Contact:
- Ice Cream Jonsey
- Posts: 30191
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
Oh - I mean the line as in any given line in the source code.Merk wrote:The length of the input line? I'm not sure which line you mean.
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!
-
- Posts: 192
- Joined: Mon Nov 22, 2004 3:19 pm
- Location: Wichita, KS
- Contact:
-
- Posts: 119
- Joined: Fri Jun 27, 2003 12:10 pm
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.
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.
- Ice Cream Jonsey
- Posts: 30191
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
Ah, right right - 1024 would be what I encountered.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.
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: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.
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!
- Ice Cream Jonsey
- Posts: 30191
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
- Ice Cream Jonsey
- Posts: 30191
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
- Ice Cream Jonsey
- Posts: 30191
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
-
- Posts: 2544
- Joined: Tue Jun 04, 2002 10:43 pm
- Ice Cream Jonsey
- Posts: 30191
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
-
- Posts: 119
- Joined: Fri Jun 27, 2003 12:10 pm
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.
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.
- Ice Cream Jonsey
- Posts: 30191
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
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.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.
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
*/
Ah! That would seem to also solve the issue. The "furBearingTrout" object is back in business, baby!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 dark and gritty...Ice Cream Jonsey!