View Single Post
Old 11-27-2006, 02:54 AM   #10
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

hmnn, I guess that with that calculus exam floating around I forgot to make the documentation anyways. Considering we declared the vec struct type of the previous post:
Collapse JASS:

globals
     vec ouch = 0 //you can initialize an struct reference at 0 in a globals declaration

//syntax error:     vec ouch = vec.create() //you cannot do struct syntax in global declarations (because global blocks are always moved to the top of the script, before functions exist.

     vec array SOLUTIONS //yes, arrays are possible,


endglobals



function doThings takes nothing returns nothing
      set ouch=vec.create()
      set SOLUTIONS[0] = vec.create()
      set SOLUTIONS[1] = vec.create()
      set SOLUTIONS[2] = vec.create()
 //and so and so...
endfunction


Collapse JASS:
struct teststatic


    static integer N=0 //unlike 'normal' struct members these are static, they are effectively just global variables with other syntax
    static integer array V


//syntax error:    integer array X //array attributes are not allowed

endstruct


function teststatic_fun takes nothing returns nothing
    set teststatic.N=teststatic.N+1
    set teststatic.V[ teststatic.N] = 8
endfunction

__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote