Replace "include hell file"

One thing that actually made life difficult in speeding up codebase work in an ASP classic project is that the situation with the include file is messy. Sometimes I find a function that I was looking to be included in an include file that is not completely connected. Does anyone have any advice on how to reorganize this so that it can be easier to determine where the function is, if they should find it?

EDIT: One thing I forgot to ask is: does vbscript have some kind of mechanism to prevent the inclusion of a file twice? Sorts like #ifndef from C?

+5
source share
6 answers

There are a few basic things you can do by accepting a classic ASP application, but you probably end up regretting what they do.

  • Eliminate duplicate include . Each classic ASP application I have ever seen had 5 login.asp pages and 7 datepicker.js files, etc. Hunt and delete all duplicates, and then change the links in the rest of the application as necessary. Be careful to check the diff for each file when you delete it - often duplicate files have slight differences, because the original author copied them and then changed only the copy. This is a great thing for Evolution, but not for code.
  • . , , . , , .
  • . , . , ( - , ASP). , , , include .

. ( ), " ASP, ". - , , ASP-, , ASP .

+14

@MusiGenisis - , -

" . ( )", " ASP, ". - , , ASP-, , ASP ".

, , , - / .

ASP, , , . , , , , . -

  • , ASP.NET. 95% . 5% - , , , ASP, .

  • , ASP.NET . , ASP . , javascript - , - .

# ifndef's, .

+10
  • ( t-head.asp). asp .
  • , (, ..) . t-begin.asp
  • , ( , Google ..) , t-begin.asp. t-end.asp
  • -, BUS. . (IE: products.asp _ *)
  • UI. .

:

<%@  Language=VBScript %>
<% Option Explicit %>
<% Response.Buffer = true%>
<html>
<head>
<!--#include file="../general/t-head.asp"-->
<!--#include file="../bus/product.asp"-->
<title>Products page</title>
</head>
<body>
<!--#include file="../general/t-begin.asp"-->

   <% 'all your code  %>

<!--#include file="../general/t-end.asp"--> 
</body>
</html>
+3

. , ASP. -.

, ASP - ( , ) , , .

include (initialise.asp ), (lib_http.asp, lib_mssql.asp ), , . . , , , , . IDE, Visual Studio Primalscript, " ", , .

script - script include.

, , script, , , - , master include . , , DLL- , vs .

, , mappath. , IIS '..\' VBScript, .

+1

, ASP VBScript Visual Basic COM DLL. .

0

, , . , , ?

, ? , , , . , , . include BAM! .

, , :

- , /, , - , .

- IDE /sub, include. , , -. (raw code, not subs or functions), include, .

. , , sub/function , , . , .

0
source

All Articles