|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I got a code piece like follow:
uv_vectors
{
#read (File,Bottom_numUV)
Bottom_numUV,
#local i=0;
#local temp=<0,0>;
#while (i<Bottom_numUV)
#read (File,temp) (*)
temp
#local i=i+1;
#end
}
And I also got a file like this:
16384,
<0.000000,0.992188>,
<0.007813,0.992188>,
<0.015625,0.992188>,
<0.023438,0.992188>,
....
but the parser said on the (*) line:
Parser error: Expected 'undeclared identifier', uv vector identifier found
instead
Forgive me to launch such a stupid question, but it is really important to
me,
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I think if you put a comma after the line that just says "temp" (that is,
make it "temp,"), then it will work. It's probably failing on the second
time through the loop when it sees two UV-vectors in a row without a comma
inbetween.
Weird error message though.
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Wasn't it lien0n who wrote:
>I got a code piece like follow:
> uv_vectors
> {
> #read (File,Bottom_numUV)
> Bottom_numUV,
> #local i=0;
> #local temp=<0,0>;
> #while (i<Bottom_numUV)
> #read (File,temp) (*)
> temp
> #local i=i+1;
> #end
> }
>
>And I also got a file like this:
>16384,
><0.000000,0.992188>,
><0.007813,0.992188>,
><0.015625,0.992188>,
><0.023438,0.992188>,
>....
>
>but the parser said on the (*) line:
>Parser error: Expected 'undeclared identifier', uv vector identifier found
>instead
>
>Forgive me to launch such a stupid question, but it is really important to
>me,
It's actually the "#local temp = <0,0>" line that's freaking it out. The
#read directive is, for some reason, refusing to read data into a
variable that currently contains a uv vector.
However, if you omit that line, the #read works the first time (when
'temp' is undefined), and happily reads a uv vector into 'temp'. Then on
the second pass, the #read directive refuses to read data into a
variable that currently contains the uv vector it read on the previous
pass.
A few quick tests show that all these workrounds work:
1. Have 'temp' be undefined whenever the #read is invoked
#local i=0;
#while (i<Bottom_numUV)
#read (File,temp)
temp
#undef temp
#local i=i+1;
#end
2. Make 'temp' be a float whenever the #read is invoked
#local i=0;
#while (i<Bottom_numUV)
#local temp = 0;
#read (File,temp)
temp
#local i=i+1;
#end
3. Make 'temp' be a 3-vector whenever the #read is invoked
#local i=0;
#while (i<Bottom_numUV)
#local temp = <0,0,0>;
#read (File,temp)
temp
#local i=i+1;
#end
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> It's actually the "#local temp = <0,0>" line that's freaking it out. The
> #read directive is, for some reason, refusing to read data into a
> variable that currently contains a uv vector.
Ohh, duh. That makes more sense.
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
many thx~ to you all guys.
Mike Williams <nos### [at] econymdemoncouk> wrote:
> Wasn't it lien0n who wrote:
> >I got a code piece like follow:
> > uv_vectors
> > {
> > #read (File,Bottom_numUV)
> > Bottom_numUV,
> > #local i=0;
> > #local temp=<0,0>;
> > #while (i<Bottom_numUV)
> > #read (File,temp) (*)
> > temp
> > #local i=i+1;
> > #end
> > }
> >
> >And I also got a file like this:
> >16384,
> ><0.000000,0.992188>,
> ><0.007813,0.992188>,
> ><0.015625,0.992188>,
> ><0.023438,0.992188>,
> >....
> >
> >but the parser said on the (*) line:
> >Parser error: Expected 'undeclared identifier', uv vector identifier found
> >instead
> >
> >Forgive me to launch such a stupid question, but it is really important to
> >me,
>
> It's actually the "#local temp = <0,0>" line that's freaking it out. The
> #read directive is, for some reason, refusing to read data into a
> variable that currently contains a uv vector.
>
> However, if you omit that line, the #read works the first time (when
> 'temp' is undefined), and happily reads a uv vector into 'temp'. Then on
> the second pass, the #read directive refuses to read data into a
> variable that currently contains the uv vector it read on the previous
> pass.
>
> A few quick tests show that all these workrounds work:
>
> 1. Have 'temp' be undefined whenever the #read is invoked
>
> #local i=0;
> #while (i<Bottom_numUV)
> #read (File,temp)
> temp
> #undef temp
> #local i=i+1;
> #end
>
> 2. Make 'temp' be a float whenever the #read is invoked
>
> #local i=0;
> #while (i<Bottom_numUV)
> #local temp = 0;
> #read (File,temp)
> temp
> #local i=i+1;
> #end
>
> 3. Make 'temp' be a 3-vector whenever the #read is invoked
>
> #local i=0;
> #while (i<Bottom_numUV)
> #local temp = <0,0,0>;
> #read (File,temp)
> temp
> #local i=i+1;
> #end
>
> --
> Mike Williams
> Gentleman of Leisure
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I tried on my computer. Only (1) works, and the last two cannot. When
working with the last two approach, same error message was given.
So it seems that i must use #undef temp to ensure temp is an undefined uv
vector variable inside each pass.
Mike Williams <nos### [at] econymdemoncouk> wrote:
> Wasn't it lien0n who wrote:
>
> It's actually the "#local temp = <0,0>" line that's freaking it out. The
> #read directive is, for some reason, refusing to read data into a
> variable that currently contains a uv vector.
>
> However, if you omit that line, the #read works the first time (when
> 'temp' is undefined), and happily reads a uv vector into 'temp'. Then on
> the second pass, the #read directive refuses to read data into a
> variable that currently contains the uv vector it read on the previous
> pass.
>
> A few quick tests show that all these workrounds work:
>
> 1. Have 'temp' be undefined whenever the #read is invoked
>
> #local i=0;
> #while (i<Bottom_numUV)
> #read (File,temp)
> temp
> #undef temp
> #local i=i+1;
> #end
>
> 2. Make 'temp' be a float whenever the #read is invoked
>
> #local i=0;
> #while (i<Bottom_numUV)
> #local temp = 0;
> #read (File,temp)
> temp
> #local i=i+1;
> #end
>
> 3. Make 'temp' be a 3-vector whenever the #read is invoked
>
> #local i=0;
> #while (i<Bottom_numUV)
> #local temp = <0,0,0>;
> #read (File,temp)
> temp
> #local i=i+1;
> #end
>
> --
> Mike Williams
> Gentleman of Leisure
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|