- Joined
- Dec 26, 2009
- Messages
- 64
So, I`m currently working on a project called romaen. Romaen searches the string for numbers, removes them, and only displays the letters. In the future, when I`m completely done, you will be able to pick to remove all numbers, certain letters, etx c. But, right now, I`m having trouble with the basic code, before I`ve added anything advanced. Currently, nothing is displayed with the BJDebugMsg.
I fixed the above code > > But any constructive criticism and comments are wanted.
JASS:
/////////////////////////////////////////////////////////////
// //
// ROMAEN //
// //
/////////////////////////////////////////////////////////////
function romaen takes string s returns string
local integer d = 0
local integer q = 0
local integer w = 1
local string n = ""
loop
if SubString(s,q,w) == "0" then
set d = 1
set s = n
else
set n = n + SubString(s,q,w)
endif
exitwhen d == 1
set q = q + 1
set w = w + 1
endloop
// set s = n
return s
endfunction
function Trig_test_Actions takes nothing returns nothing
local string s = "lol"
call BJDebugMsg(romaen(s))
endfunction
function InitTrig_test takes nothing returns nothing
set gg_trg_test = CreateTrigger( )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_test, Player(0) )
call TriggerAddAction( gg_trg_test, function Trig_test_Actions )
endfunction
I fixed the above code > > But any constructive criticism and comments are wanted.