• 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.

[JASS] First JASS Function...err

Status
Not open for further replies.
Level 2
Joined
Sep 21, 2005
Messages
27
Hi, I just recently decided a map I'm working on would benefit from some JASS(lots of "Points"! :p )

Perhaps some JASS guru could educate me on why the following function throws 4 or more "Expected 'endloop'" errors.

I'm used to Javascript, and I must say....JASS is REALLY structured. Makes it difficult to learn without reading tutorials.

JASS:
function Trig_Generate_Points_New_Actions takes nothing returns nothing

// Free Locations
loop
call RemoveLocation(udg_PointIndex[udg_PointCount])
set udg_PointCount = udg_PointCount-1
exitwhen udg_PointCount == 0
endloop

// Reset Tile Count
set udg_TileCount = 0

// Allocate Local Values
local integer RandomValue
local integer NumLoops = 0
local integer PosX
local integer PosY

endfunction

Although I plan to move away from locations, I need to know why the loop isn't ending despite there being an 'endloop'.

Thanks,
 
Level 2
Joined
Sep 21, 2005
Messages
27
Ahh, I logged onto bnet and pestered DarnYak. Apparently local variables can only be initialized before executable code. :D
 
Status
Not open for further replies.
Top