Best place to declare constants?

Results 1 to 2 of 2

Thread: Best place to declare constants?

  1. #1
    TM Guest

    Default Best place to declare constants?

    Hi, I would like to know where is the best place to put constant variables. Should I place them inside an include file (.asp extension), or place them into the global.asa file as application variables. <BR><BR>What are the advantages and disadvantages of using both methods?<BR><BR>Thanks for any help or resources that can direct me in the right direction. :)<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    572

    Default RE: Best place to declare constants?

    I don&#039t know whether constants decleared in global.asa will be available in other pages or not, but I know for sure that const. decleared in Application_OnStart will not be available inside Session_OnStart(I didn&#039t try, but I&#039m assuming they will not be available anywhere else either). You can try and see if my assumption is right. Another thing is that if your constant will be used inside one page only, declare it inside that page(or include file). Remember that ASP does inline include only, so const. decleared in your include file can&#039t be redefined in the including ASP file.<BR>Does it 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
  •