• 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.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

[JASS] Syntax error

Status
Not open for further replies.
Level 8
Joined
Sep 24, 2007
Messages
300
JassCraft reports syntax error on line 499 (return 10). What's wrong?

Code:
function cn takes string u returns integer
local string Cn=" !\"#$"+Bn()+"&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
local string c
local integer i=0
if(u=="\b")then
return 8
elseif u=="\t" then
return 9
elseif u=="
" then
return 10
elseif u=="\f" then
return 12
elseif u=="
" then
return 13
endif
loop
set c=SubString(Cn,i,i+1)
exitwhen c==""
if c==u then
return i+32
endif
set i=i+1
endloop
return 0
endfunction
 
Status
Not open for further replies.
Top