vb.net For loop in If statement - shorten the ElseIf -
how shorten this: information: %washv% constant coming outer loop %loop%.
i tried loop in elseif / new if statement failed
thanks.
code:
|if [%loop%] = "1" return "true" elseif [%loop%] =96-(96-round([5000/%washv%])) return "true" elseif [%loop%] =96-(96-2*round([5000/%washv%])) return "true" elseif [%loop%] =96-(96-3*round([5000/%washv%])) return "true" elseif [%loop%] =96-(96-4*round([5000/%washv%])) return "true" elseif [%loop%] =96-(96-5*round([5000/%washv%])) return "true" elseif [%loop%] =96-(96-6*round([5000/%washv%])) return "true" elseif [%loop%] =96-(96-7*round([5000/%washv%])) return "true" elseif [%loop%] =96-(96-8*round([5000/%washv%])) return "true" elseif [%loop%] =96-(96-9*round([5000/%washv%])) return "true" else return "false“ end if|
if vb.net, simplification can done this:
for integer = 1 9 if [%loop%] =96-(96-i*round([5000/%washv%])) return "true" end if next return if([%loop%] = "1", "true", "false")
yet, more pressing matter find out use of %loop% , %washv%.
the use of % in rightside of vb.net variable during initialization indicates integer:
dim a% 'integer
check this: what percentage symbol mean part of variable name?
there many other symbols $, &, !, @, , # too.
but left %, know not.
it looks more query language me, this:
... s '%loop%'
Comments
Post a Comment