Page 1 of 1

struct definition error

Posted: Wed Apr 02, 2008 2:28 pm
by innominabile
var start := Struct { "hp" := CInt(GetVital(caster, VITALID_LIFE) / 100),
"x" := Cint(caster.x), "y" := Cint(caster.y), "z" := Cint(caster.z), "realm" := Cstr(caster.realm) };

is ok but

var start := Struct { "hp" := CInt(GetVital(caster, VITALID_LIFE) / 100),
"x" := caster.x, "y" := caster.y, "z" := caster.z, "realm" := caster.realm };

is not ok.
It build struct
start struct { realm := struct { x := .....

Posted: Thu Apr 03, 2008 7:13 am
by ncrsn
That's odd.

I put the latter inside a print()-function and it worked just fine. Using POL 097 2008-02-26 if that makes a difference.

Code: Select all

var start := Struct { "hp" := CInt(GetVital(caster, VITALID_LIFE) / 100), 
"x" := caster.x, "y" := caster.y, "z" := caster.z, "realm" := caster.realm };
print(start);

Posted: Thu Apr 03, 2008 9:39 am
by innominabile
I used a print to verify the problem... and print show start is defined like a struct that contains another struct inside: realm with contains inside it remaining struct values lile "x" "y" "z".... and using last pol097-2008-02-26....

I have a long history in error ins truct declaration.

But staff to not trust me.

It seem only I have problems on struct...

For exampe I have found it is very different also in function parameters use:

var pars := Struct { ........... };
call_function (who, pars);

and the other syntax:

call_function (who, Struct { ........... } );