[14 Apr 2010] preprocessor commands: IF THEN ELSE..? Different @INCLUDE paths?

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
nexus
Posts: 150
Joined: Sun Mar 07, 2010 11:54 am

[14 Apr 2010] preprocessor commands: IF THEN ELSE..? Different @INCLUDE paths?

Post by nexus »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 14 Apr 2010 13:11:57 -0000

Some questions:

1) Are there any preprocessor commands like IF THEN ELSE to avoid including files multiple times, i.e.

Code: Select all

IF not defined(MYINCLUDE-CODE-A)
@INCLUDE MYINCLUDE-CODE-A
ENDIF
Or how is it possible to avoid including a file twice?

2) How do i have to write @INCLUDE-paths and paths to recources (like txt-files) which have to be loaded dynamically, such that these files can be found on all supported operating systems?

For example, on Windows, you have to use backslash "\" while on AmigaOS and MacOS, you have to use slash "/" to navigate downward in the directory structure.

More important, on AmigaOS you use slash "/", on MacOS and Windows doulbe dots ".." to navigate upwards.

So what do I have to do in order to make sure, everything works on all systems?

Thanks, Tom
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[15 Apr 2010] Re: preprocessor commands: IF THEN ELSE..? Different @INCLUDE paths?

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 15 Apr 2010 12:53:12 +0200
Some questions:

1) Are there any preprocessor commands like IF THEN ELSE to avoid including files multiple times, i.e.

Code: Select all

IF not defined(MYINCLUDE-CODE-A)
@INCLUDE MYINCLUDE-CODE-A
ENDIF
Or how is it possible to avoid including a file twice?
That is handled by Hollywood automatically. Hollywood will keep track of all files it includes and if it detects a double include, it will simply skip that @INCLUDE directive.
2) How do i have to write @INCLUDE-paths and paths to recources (like txt-files) which have to be loaded dynamically, such that these files can be found on all supported operating systems?

For example, on Windows, you have to use backslash "\" while on AmigaOS and MacOS, you have to use slash "/" to navigate downward in the directory structure.
Windows also supports the normal slash in most cases.
More important, on AmigaOS you use slash "/", on MacOS and Windows doulbe dots ".." to navigate upwards.
True, there is currently no way around this but the next version of Hollywood includes an OS independent DOS handler which means that you can also use ".." on AmigaOS systems. The downside of this is that files beginning with ".." are no longer supported on AmigaOS but I think we can sacrifice this :)

And no worries, it will be a free update and to be released pretty soon :)
Locked