Jesus4Lyf
Good Idea™
- Reaction score
- 397
5 minutes ago, I thought I'd try something new.
Azlier. <3
Typecasting from nothing still works. Our research was not in vain.
At the end of 1.23, we found that typecasting from nothing returns the last item returned. We joked about optimising TimerUtils with it (by typecasting from TimerStart(CreateTimer... returning the timer in H2I).
So um. There's a nice typecast integer to boolean. I thought this may work and it does.
Azlier. <3
Typecasting from nothing still works. Our research was not in vain.
JASS:
function ReturnI takes integer i returns integer
return i
endfunction
function ReturnB takes boolean b returns boolean
return b
endfunction
function I2B takes integer i returns boolean
call ReturnI(i)
if i==0 then
return false
endif
endfunction
function B2I takes boolean b returns integer
call ReturnB(b)
if b==false then
return 0
endif
endfunction
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
call BJDebugMsg(I2S(B2I(I2B(50))))
endfunction
At the end of 1.23, we found that typecasting from nothing returns the last item returned. We joked about optimising TimerUtils with it (by typecasting from TimerStart(CreateTimer... returning the timer in H2I).
So um. There's a nice typecast integer to boolean. I thought this may work and it does.