• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Define a variant which is real number.

IceFrogBG

Member
Hi all,
I want to make a function which can be work with real number (ex : 0.3 or 1.2 ...)
So can I define as
Sub RunProcessBar(byval num as long)
code here....
end sub.
Thanks all.
 
Hi ,

When you declare a subroutine as :

Sub RunProcessBar(ByVal num as Long)

the procedure will accept a parameter that is of type Long ; this means that the parameter can only have integer values within specified limits ; see this link for details :

https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/data-types/long-data-type

If you want the input to be a decimal value , use the type identifier Single or Double , as in :

Sub RunProcessBar(ByVal num as Single)

Sub RunProcessBar(ByVal num as Double)

Narayan
 
Hi ,

When you declare a subroutine as :

Sub RunProcessBar(ByVal num as Long)

the procedure will accept a parameter that is of type Long ; this means that the parameter can only have integer values within specified limits ; see this link for details :

https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/data-types/long-data-type

If you want the input to be a decimal value , use the type identifier Single or Double , as in :

Sub RunProcessBar(ByVal num as Single)

Sub RunProcessBar(ByVal num as Double)

Narayan
Hi NARAYANK991
I understand.
Thanks so much.
 
Back
Top