| View previous topic :: View next topic |
| Author |
Message |
Petru
Joined: 17 Dec 2007 Posts: 235 Location: Galati, Romania
|
Posted: Fri Nov 20, 2009 10:36 am Post subject: Problem with #includes |
|
|
I've got a main script M that is divided into more smaller scripts by #includes.
Consider:
M is dependant on S1 and is dependant on S2.
S1 is also dependant on S2.
=>
I can't #include S1 in S2 and also #include S1 in M because it will give me an error.
S1 doesn't work without S2, so if I want to work on S1 I have to #include S2 in it but M will give an error.
I don't want to get tangled in #includes... I'm now working on a much larger script... what can I do? |
|
| Back to top |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7295 Location: Australia
|
Posted: Fri Nov 20, 2009 12:49 pm Post subject: Re: Problem with #includes |
|
|
| Petru wrote: | | I can't #include S1 in S2 and also #include S1 in M because it will give me an error. | What sort of error? An error should only occur if the file can't be legitimately "inserted" at the position of the #Include. If the file was already #included, a second #Include will have no effect. Only #IncludeAgain can "insert" the same file twice at different locations.
| Quote: | #Include ensures that FileName is included only once, even if multiple inclusions are encountered for it. By contrast, #IncludeAgain allows multiple inclusions of the same file, while being the same as #Include in all other respects.
Source: #Include |
Function libraries work similarly to #Include, but are inserted at the very end of the script, in the order they are needed. |
|
| Back to top |
|
 |
Petru
Joined: 17 Dec 2007 Posts: 235 Location: Galati, Romania
|
Posted: Fri Nov 20, 2009 1:48 pm Post subject: Re: Problem with #includes |
|
|
| Yep, you were right, Lexikos. I'm just very fuzzy today... |
|
| Back to top |
|
 |
|