Example:
function! MyFunction()
exe 'call Include("'.mykeyw.'")'
Return value???
endfunction
function! Include(keyw)
if condition == ""
return 0
endif
endfunction
If return
in Include()
is invoked I want to stop executing MyFunction()
as well.
It seems that there is no way other then checking the return
value from the return statement from Include()
in MyFunction.
But how do I check the return value from Include()
in MyFunction()
??
P.e. In this case, how do I capture the return
value '0' from Include()
in MyFunction()
?
Functions can be used as expressions; so you can simply store the return value of Include()
in a variable or use it in a conditional:
function! MyFunction()
let value = Include(mykeyw) " stored as a variable
" or
if Include(mykeyw) == 1 " used in a conditional
echo "Yay!"
else
echo "Nay!"
endif
endfunction
function! Include(keyw)
if condition == ""
return 0
endif
endfunction
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With