Results 1 to 3 of 3

Thread: Define constant

  1. #1
    snip
    Guest

    Define constant

    hi, I now writing a activeX control and want to define some constant which is able to use by the program which include this dll. e.g. I may define a constant pi=3.1416 and name this dll to Math.dll. Then I new a project and add it to reference, I could able to use the constant pi.

    I have new a module and add a public constant, but this don't work, so what should I do?

    Thank!

  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    Add a new Basic Module file and just declare as
    VB Code:
    1. Public Const pi As Double = 3.1416

    or you can declare under the UserControl source file
    regards,

  3. #3
    snip
    Guest
    Thank Chris, but if I use public constant, it constant will only available within the class. I have got the solution from the other, I should use "Public Enum". but anyway, thank for your help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width