Page 1 of 1

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

Posted: Sat Jun 13, 2020 5:32 pm
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

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

Posted: Sat Jun 13, 2020 5:32 pm
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 :)