includes in includes..

Results 1 to 3 of 3

Thread: includes in includes..

  1. #1
    Join Date
    Dec 1969

    Default includes in includes..

    Let&#039s say I have a page like so:<BR><BR>&#060;html&#062;<BR>&#060;body&#062;<BR >&#060;!-- #INCLUDE file="checkcookie.asp" --&#062;<BR>content<BR>&#060;!-- #INCLUDE file="botnav.asp" --&#062;<BR>&#060;/body&#062;<BR>&#060;/html&#062;<BR><BR>with checkcookie being:<BR><BR>if IsCookie then<BR> if X then<BR> &#060;!-- #INCLUDE file="nav1.asp" --&#062;<BR> botnav=1<BR> else<BR> &#060;!-- #INCLUDE file="nav2.asp" --&#062;<BR> botnav=2<BR> End If<BR>Else<BR> &#060;!-- #INCLUDE file="nav.asp" --&#062;<BR> botnav=3<BR>End If<BR><BR><BR>and then for botnav.asp (included on the bottom of first page)<BR><BR>if botnav=1<BR> then<BR> &#060;!-- #INCLUDE file="botnav1.asp" --&#062;<BR> elseif botnav=2 then<BR> &#060;!-- #INCLUDE file="botnav2.asp" --&#062;<BR> else<BR> &#060;!-- #INCLUDE file="botnav3.asp" --&#062;<BR>End If<BR><BR><BR><BR>Would that work? Having includes in includes, and one of the includes defining a variable which another include will use later? Or should I check cookie all overagain? I rather not since the includes are inside of a db and don&#039t want to keep opening it..<BR><BR>I am not asking on help doing this, just want to know if the above is "theoretically " correct.<BR><BR>thanks, - Leo

  2. #2
    Karl Guest

    Default RE: includes in includes..

    At first glance the answer is yes. I tried it out to be sure and the answer is yes. I also took this as a chance to read an 4Guys article I&#039ve had bookmarked for a it they confirm that you can...chek it out if you are interested<BR><BR><BR><BR>(that&#039s part 2 which is where it says includes can include includes (at the top).<BR><BR>1 include can use a variable defined by another (so long as your defining include is before your other include). <BR><BR>--<BR>Karl

  3. #3 Guest

    Default RE: includes in includes..

    Karl has already given you the answer you wanted, and that is how I also thought it would be. <BR><BR>I just thought I would add a minor point about defines in Visual Interdev. I find it better to define my vars in the main script, because if you do the defines there I can use the auto-complete facility to make sure that my variables are spelt correctly. eg:<BR><BR>If I have a variable "MyVariable", I can type "MyV" and hit Ctrl-Space, and I can pick the name from the dropdown list. If I had to type the name completely every time, I would probably miss-spell it sometimes. <BR><BR>You might call this lazy, but I see it as a way of using the features of my programming tool to ensure better quality coding. If I do the defines in the include file, I do not have auto-complete.

Posting Permissions

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