HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Undeclared Struct Member *Error*

12-09-2007, 08:38 PM#1
xombie
Collapse JASS:
private struct innerchiData
    unit caster
    timer update =CreateTimer( )

    static method create takes unit caster returns innerchiData
        local innerchiData d =innerchiData.allocate()
        set d.caster=caster
        return d
    endmethod

    method getTimer takes nothing returns timer
        return .update
    endmethod
endstruct

This is the struct (more or less) that I use for my spell- I will explain the 'getTimer' method later. Anyways...

Collapse JASS:
private function update takes nothing returns nothing
    local innerchiData d =1

    loop
        exitwhen d.update == GetExpiredTimer( )
        set d=d+1
    endloop


This code is meant to find which 'innerchiData' is the one I want, based on the struct's 'update' timer. However, when I do this, I get an error:

"update is not a member of innerchiData"

It quite obviously is a member, and to add to that, this new method of code actually works:

Collapse JASS:
private function update takes nothing returns nothing
    local innerchiData d =1

    loop
        exitwhen d.getTimer( ) == GetExpiredTimer( )
        set d=d+1
    endloop
...
endfunction

Can somebody please explain to me why it isn't detecting 'update' as a valid member of 'innerchiData'.
12-09-2007, 09:27 PM#2
xombie
The solution is to change the name of the member- how odd.