I know I've seen the answer to your question somewhere, but can't find it at the moment. So here's more than you wanted to know about hoc's rules for user-created variable names.
0. A name is a string that starts with an alpha character and contains < 100 alphanumeric characters or the underscore _
1. User-created names must not conflict with keywords or built-in functions.
2. Each user-created variable name is one of the following types:
double precision scalar, array of scalars (also called a "double"), strdef, objref, section
3. If a user-created variable name is to have a nonscalar type, its first appearance in the program must be in a declaration statement that occurs outside of any func or proc. Examples:
double xyz[3]
strdef bar
objref foo
create baz
4. Once a name has been assigned a type, it can only be redeclared as the same type.
Regarding your particular question: execute the following example and note the results:
Code: Select all
NUM = 3
create foo
print "First result:"
forall print secname()
print " "
proc test() { i
create foo[NUM]
}
test()
print "Second result:"
forall print secname()