We help IT Professionals succeed at work.

don't understand this  -  System.Nullable(Of Integer))

andieje
andieje asked
on
Medium Priority
294 Views
Last Modified: 2006-11-18
Hi

I have a function automatically created for me by visual studio. the function includes this parameter

  ByRef JobID As System.Nullable(Of Integer))


This parameter is given a value during the function that i need to access. I don't understand what System.Nullable(Of Integer)) means

Please can you show me how i declare a variable that i can pass into this function and how i can then access its value

what does the system.nullable mean?

Thanks a lot
andrea
Comment
Watch Question

It's a brilliant feature:

it will allow you to check if a value is nothing which never really worked for value types like integer

So you can e.g. create a sub like

Public sub testing (testVal as System.Nullable(integer))

'try to see if it has a value
if testVal.HasValue then
messagebox.show ("so happy")
end if

end sub

call your sub like:
testing (nothing)
or testing (1)

in your sub you can get the value like
testVal.Value

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.