Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adjusting path of included files
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00603937
Message ID:
00604031
Vues:
15
>In all pages, I have some ASP include commands. When I go in sub directories, in order to include the same file, I need to adjust the path in all of them. As we can't reference the path from the / to indicate the startup of the root or from the HTTP equivalent, we have to rely based on the location we are. So, this forces me to adjust that line in several files along all the sub directories that I have. I would like to avoid that. How can I resolve that?
>
>For example, here is some examples or the same line I have to modify on three levels of directories.
>
>
>#INCLUDE FILE=menu.html
>#INCLUDE FILE=../menu.html
>#INCLUDE FILE=../../menu.html
>
>
>The problem with that is that I would like to keep the same line no matter where the file is. So, if I move the file to another directory, it'll still work.

Michel,

I'd say that there must be some logic to why the location of the menu.html changes. I mean, couldn't you have some &cPrefix..menu.htm ?
>As we can't reference the path from the / ...
This probably tells that you can't have the cPrefix solution, but why ?

And, couldn't you have some function that tries to find it in the hierarchy (File()) starting at the prio location (it may occur more in different versions ?).

Some cCoreURL won't help you either ?

What about incorporating the path of the program Including it ? Won't the menu.htm relative to that ? SYS(16) (by heart, similar to PROGRAM()) will give you the path of the program.

Last trial : can't you include twice ? (just don't know whether that's allowed). I mean, Include IncludeScript.xxx and in there the real include is residing, allowing you to change it only once. Or ehh, DO IncludeProgramForApp which containes the Include ?

I'm afraid I don't get it. :(
But this must be solvable by some arrangements during the Init of the app / session, don't you think ? (the cPrefix solution).
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform