View Single Post
Old 03-20-2010, 03:38 PM   #3556
Barade
User
 
Barade's Avatar
 
Join Date: May 2006
Posts: 163

Barade is on a distinguished road (14)

Default

Just one little thing about the syntax validation:
Collapse JASS:
struct AFrame extends AWidget
        private AFrameBar m_barTop
        private AFrameBar m_barBottom
        private AFrameBar m_barLeft
        private AFrameBar m_barRight

        public static method create takes AMainWindow mainWindow, real x, real y, real width, real height return thistype // s of returns is missing
            local thistype this = thistype.allocate(mainWindow, x, y, width, height, null, 0, 0)
            set this.m_barTop = AFrameBar.create(mainWindow, AFrame.styleTop, x, y, 20.0, width)
            set this.m_barBottom = AFrameBar.create(mainWindow, AFrame.styleBottom, x, y + height - 20.0 , 20.0, width)
            set this.m_barLeft = AFrameBar.create(mainWindow, AFrame.styleLeft, x, y, 20.0, height)
            set this.m_barRight = AFrameBar.create(mainWindow, AFrame.styleRight, x + width - 20.0, y, 20.0, height)

            return this
        endmethod

    endstruct
Would be more useful to show a message like "Missing returns statement" instead of "method create must return AFrame".

edit:
Another thing:
Collapse JASS:
set this[i] = this[i] + value
It says "this is not an array" although I implemented the []= operator.
__________________
Barade is offline   Reply With Quote
Sponsored Links - Login to hide this ad!