[23 Feb 2012] @include & constants

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

[23 Feb 2012] @include & constants

Post by nexus »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 23 Feb 2012 13:32:26 -0000

It seems you cannot include files like this:

Code: Select all

const #constant1="path/to/dir/"
const #constant2="filename"

@Include #constant1..#contant2
I wonder why this is the case, since both Strings are constants. The following examples work (according to the documentation) for constnats:

Code: Select all

const #consttest1 = (5*10) / 2 

or 

const #consttest2 = #consttest1 * 5
regards, nexus
nexus
Posts: 133
Joined: Sun Mar 07, 2010 11:54 am

[23 Feb 2012] Re: @include & constants

Post by nexus »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 23 Feb 2012 13:39:35 -0000

And the following seems also not possible

file1.hws:

Const #MYCONST="path/to/dir/file2.hws"

file2.hws:

@INCLUDE #MYCONST

The following error occurs then:

"The constant #myconst has already been decleared"

So, I wonder, how I can include a file whose location or name is not known before that file exists? Is there a way to dynamically include files?

regards, nexus
nexus
Posts: 133
Joined: Sun Mar 07, 2010 11:54 am

[23 Feb 2012] Re: @include & constants

Post by nexus »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 23 Feb 2012 13:42:26 -0000

Since I previously made a mistake, I deleted that post and wrote it again. So, here is the problem description:

The following seems also not possible

In file1.hws:

Const #MYCONST="path/to/dir/file1.hws"

In file2.hws:

@INCLUDE #MYCONST

The following error occurs then:

"The constant #myconst has already been decleared"

So, I wonder, how I can include a file whose location or name is not known before that file exists? Is there a way to dynamically include files?

regards, nexus
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[25 Feb 2012] Re: @include & constants

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 25 Feb 2012 12:17:07 +0100
It seems you cannot include files like this:

const #constant1="path/to/dir/" const #constant2="filename"

@INCLUDE #constant1..#contant2

I wonder why this is the case, since both Strings are constants.
Yes, that's currently not supported but you're right it should be supported for consistency reasons. I'll add it to the to do list.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[25 Feb 2012] Re: Re: @include & constants

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 25 Feb 2012 12:19:42 +0100
And the following seems also not possible

file1.hws:

Const #MYCONST="path/to/dir/file2.hws"

file2.hws:

@INCLUDE #MYCONST

The following error occurs then:

"The constant #myconst has already been decleared"

So, I wonder, how I can include a file whose location or name is not known before that file exists? Is there a way to dynamically include files?
The name of the include file needs to be known at compile time. It is not possible to include files whose names are only known at run time.

But the above behaviour is the same as in your previous mail. Hollywood currently doesn't support any string constants in the preprocessor commands. I'll try to support them in the next version.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[01 Apr 2012] Re: Re: @include & constants

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 01 Apr 2012 15:16:51 +0200
So, I wonder, how I can include a file whose location or name is not known before that file exists? Is there a way to dynamically include files?
Hmm, actually, I cannot reproduce this problem. It seems to work fine. Could you present more details please?
nexus
Posts: 133
Joined: Sun Mar 07, 2010 11:54 am

[02 Apr 2012] Re: @include & constants

Post by nexus »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 02 Apr 2012 09:23:31 -0000
Hmm, actually, I cannot reproduce this problem. It seems to work fine. Could you present more details please?
Sorry, actually, I seem to have forgotten myself what the problem was ;) I tried to recreate the problem and I couldn't see the error message again. So, I probably did some other mistake.

What I tried in general is to include a script whose name is not known in beforehand. However

'@INCLUDE #SOMECONST'

seems to be fine.

Sorry, for my confusing emails ;)

nexus
Locked