include guards in asp

Results 1 to 3 of 3

Thread: include guards in asp

  1. #1
    watcher Guest

    Default include guards in asp

    Does any body know if its possible use some sort of include guards in ASP/vbscript, as i want to avoid annoying problems caused by doing the following:<BR><BR>classA.asp includes classB.asp<BR>pageA.asp includes classA.asp and classB.asp - error as vbs thinks it sees a class redefinition.<BR><BR>Any help will be gratefully appreciated.

  2. #2
    Join Date
    Dec 1969

    Default RE: include guards in asp

    Yes... structure your code differently. ;-)<BR><BR>Why would pagea.asp INCLUDE both, when they are already both INCLUDEd by referencing classA.asp? Is there a reason to specifically and separatety INCLUDE classB.asp in pagea.asp? I guess I don&#039t understand why you would do this.

  3. #3
    Dan Taflin Guest

    Default RE: include guards in asp

    I have not used ASP classes, so I don&#039t know whether redefining a class causes an error (I presume it does since you say so), but ASP doesn&#039t seem to mind if you redefine a function. We had exactly that happen when we inadvertantly included two ever-so-slightly different versions of a function. No ASP errors, but it didn&#039t do what we expected it to because it was using the "wrong" version of the function.<BR><BR>I prefer to enforce a strict separation between "regular web page" files and "include files," with the rule that only regular web page files are allowed to include another file. If a particular "include" file requires the presence of another "include" file to work properly, then simply state that in a comment at the top of the file, rather than using the #include statement.

Posting Permissions

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