asp.net - VB Single line with null values -
I have the following code that I do not believe is working properly and I can not understand why. Expected Result: Actual results: I do not understand if the statement is not going in the correct section and in the variable total Nothing is putting In this case, it can not guess the type from the first option ( I do not understand if the if statement is not jumping to the right section and nothing is done in the variable total this Well that's what it's doing. However, as mentioned earlier, in VB.Net I have not tested, but I think your Slow number in the form of decimals? = If (nothing is before or second, there is nothing, _ nothing, _ Math.Ebus (if (first, 0D)) - Math.Ebus (if (second, 0D)) before or second , then nothing should be kept in
total . , If there are values in both, then both of them must be converted into positive values and
first - second should be calculated. First and second are both qualified decimal (decimals?). / P>
before = none = nothing = nothing:
first = nothing = nothing = 0d
if () operator is typed strongly , But the compiler has been estimated that kind of result based on input
nothing ), because the self does not have any type, and not the opposite of C #
null , anything can not be lower than the value type (it will be important in an instant). Therefore the compiler should see the second option:
Math.Abs (if (first, 0D)) - Math.Abs (if (seconds, 0D)). The type of this expression evaluates
decimal ... no a
decimal . Therefore, if the result of your entire
if () expression is a
decimal , and not a
decimal? . Do you assign results to
decimals? does not matter.
can not specifies the value types before assignment, nothing is not converted to decimal, because the < Code> if () the result of the expression is in the case of a decimal, specify the value of not having anything in the default decimal value of
0D ... so your results
if () operator
decimal clearly your desired outcome by casting false expression as Can you fix this to get it? /
Nullable (of Decimals) . This
decimal instead of
if () expression
decimal to tell the compiler to count, and so
does not return anything that expression will be the desired output.
Comments
Post a Comment