Tasks
Code
Create 5 footmen units and print their handleid to screen.
Declare 2 local variables and let them point to the same unit, then print both of their handleids.
JASS:
scope Part1n2 initializer main
private function main takes nothing returns nothing
local integer i = 0
local real x
local real y
local unit man1
local unit man2
loop
exitwhen i == 5
set x = GetRectCenterX(bj_mapInitialPlayableArea) + 300*Cos(((I2R(i) + 1)*(360/5))*bj_DEGTORAD)
set y = GetRectCenterY(bj_mapInitialPlayableArea) + 300*Sin(((I2R(i) + 1)*(360/5))*bj_DEGTORAD)
set man1 = CreateUnit(Player(0), 'hfoo', x, y, GetRandomReal(0, 359))
set man2 = man1
set i = i + 1
endloop
call BJDebugMsg("1st handle is " + I2S(GetHandleId(man1)))
call BJDebugMsg("2nd handle is " + I2S(GetHandleId(man2)))
endfunction
endscope