HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

question about create a struct or not

12-08-2007, 07:48 PM#1
Troll-Brain
an example :

Collapse JASS:
function test takes nothing returns nothing
    local infos o

    if B then
       set o = infos.create()
    endif
endfunction

if B == false, i dont need to create a struct.
But if B == false i lost a possible struct or not ?
Must i use a global instead a local ?
I don't think so but i ask for be sure
12-08-2007, 08:34 PM#2
Ammorth
no, you only create a struct when you call .create() A variable does not use up a struct.
12-09-2007, 10:52 AM#3
Troll-Brain
thx, i've read the .j and i see it's just an integer.
Next time i will check before ask ^^.

But i got a compile error when i do that :

Collapse JASS:
struct infos
    string ordre = null
    integer stocke = 0
    real x = 0
    real y = 0
    widget w = null
endstruct

struct erre extends infos
    timer t
endstruct

undeclared variable f__arg_this and yes when i read the PJass script, it's true :(

I've the jassnewgenpack4b
12-09-2007, 01:53 PM#4
The Kingpin
I'm not sure what you're trying to do, but I believe structs only extend interfaces, not other structs.
12-09-2007, 02:00 PM#5
Vexorian
Quote:
Originally Posted by Troll-Brain
thx, i've read the .j and i see it's just an integer.
Next time i will check before ask ^^.

But i got a compile error when i do that :

Collapse JASS:
struct infos
    string ordre = null
    integer stocke = 0
    real x = 0
    real y = 0
    widget w = null
endstruct

struct erre extends infos
    timer t
endstruct

undeclared variable f__arg_this and yes when i read the PJass script, it's true :(

I've the jassnewgenpack4b
You probably need to update your jasshelper or file it as a bug report.
12-09-2007, 03:15 PM#6
Troll-Brain
@Vexorian : i've upated the jasshelper with your link in your signature and it's still the same.
I report it here
http://wc3campaigns.net/showthread.p...344#post981344