Results 1 to 6 of 6

Thread: Option Explicit

  1. #1

    Thread Starter
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    I moved it to the OPTION EXPLICIT to the top of the page and it works fine (except for me not having your com object installed, of course)

    Code:
    <%@Language=VBScript%>
    <% Option Explicit %>
    <html><head><title>Telephone Object Example</title></head>
    <body>
    <%  
      
      Dim objTelephone
      set objTelephone = Server.CreateObject("MyTelephone.Telephone")
      
      objTelephone.Color = "Blue"
      objTelephone.Material = "Thermoplastic"
      objTelephone.Weight = 22
      objTelephone.NumberOfKeys = 12
      
      Response.Write "Done"
      Set objTelephone = Nothing
    %>
    </body>
    </html>

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Cool...Is the Language tag at the top of your code required in an asp page? I remember readin' that's its the default, but I'm not sure. Still new to asp. Thanks

  3. #3

    Thread Starter
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    I don't think its required but you should always include that for the sake of clarity

  4. #4
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    I thought that if you only use one language on your server, you make sure it's set as the server default, and you leave the @language tag out to skip the extra line of code processing.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  5. #5

    Thread Starter
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    Explictly declaring items in your code actually makes it process faster.

    For example: declaring Language, EnableSessionState=False and Option Explicit speed up your output by approximately 5-10% or so.

    There was a great article on ASP today about enhancing performance in ASP and they covered this in great deal with benchmarks to prove it. Unfortunately, their site is no longer free, so my bookmark is useless (at least to me,anyways)

    http://www.asptoday.com/content/articles/20000113.asp

  6. #6
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Sucks to Wrox

    They were so nice before...
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

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