• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Why does this return a syntax error?

Status
Not open for further replies.
Level 14
Joined
Apr 20, 2009
Messages
1,543
Am I using it properly or...?

JASS:
scope parallellograms

    globals
        integer numberOfParallellograms = 0
    endglobals

    struct parallellogram extends array
        integer x1
        integer x2
        integer x3
        integer x4
        integer y1
        integer y2
        integer y3
        integer y4
    endstruct

    function someFunction takes nothing returns nothing
        local real array x
        local integer i = 1
        local real minX
        set x[1] = parallellogram[numberOfParallellograms].x1
        set x[2] = parallellogram[numberOfParallellograms].x2
        set x[3] = parallellogram[numberOfParallellograms].x3
        set x[4] = parallellogram[numberOfParallellograms].x4
        if x[i] < minX
        endif
    endfunction

endscope

It gives a syntax error on if x < minX why is this?
Also please correct me on any mistakes that I might've made, I'm trying to learn vJass...

Oh I see that I'm doing quite a lot of things wrong here with the struct array, I'll go over nestharus's tutorial on coding efficient vJass structs before continueing :)
 
Status
Not open for further replies.
Top