vb.net - Visual Basic Not all code paths return a value -


in visual basic 2010, program compiles without problem. however, warning "not code paths return value" on function. since our assignment requirement must submit without error , warning need solve these error.

part of sample code:

dim integer = 0  dim currentchar string = frmmycompiler.textbox.text(i)  function tonextword()      = + 1      currentchar = frmmycompiler.textbox.text(i) end function  

my function did not have data type because no need return anything. can vb use void same c++ ?? know how overcome problem?

use sub tonextword() return void, instead of function. here have documentation.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -