Is it okay to just use stralloc once (i.e. stralloc(80)) at the start of a program, and then never use it again? In the code below:

parse:
// stralloc( 80 );
// YIPES! Every time through the loop?
// -- -----------------------------------------------------
// I know, I know. Parse is the loop from hell. /PAP
// -------------------------------------------------------
//mov( eax, w );
stdin.flushInput();
console.setOutputAttr( win.fgnd_LightMagenta | win.bgnd_Blue );
stdout.put(">");
console.setOutputAttr( win.fgnd_LightGreen | win.bgnd_Blue );
stdin.gets(w);
console.setOutputAttr( win.fgnd_White | win.bgnd_Blue );

"stralloc(80)" is commented out, and 11 lines down:

stdin.gets(w);

is used to seek input from the user and store it in "w" string.
Does this work as it should, or should I also be using stralloc(80)?

Would using stralloc(80) every time through the loop eventually cause problems?
According to others, it might eventually cause problems.

Also, the link for the Yahoo group "hlaadventure" is:

http://groups.yahoo.com/group/hlaadventure/

For some reason the link on the main HLA page doesn't work. It gives the output "There is no group called hlaadventure%20."

Sincerely,

Paul Panks
dunric@yahoo.com
Posted on 2003-05-16 12:39:23 by Paul Panks

Is it okay to just use stralloc once (i.e. stralloc(80)) at the start of a program, and then never use it again? In the code below:

Paul Panks
dunric@yahoo.com


Sure.
But it's a whole lot easier to do the following:

static
s: str.strvar(80);

This will statically reserve storage for your string and initialize it properly.
Cheers,
Randy Hyde
Posted on 2003-05-20 12:39:26 by rhyde