Page 1 of 1

[const] Directory

Posted: Sat Mar 16, 2019 5:28 pm
by Harley
Hi everybody! I guess my ideas will be very usefull and helpfull for all of us!
I don't know, if someone make this offer yet, but as you saw in my subject, I propose to make possible to add in const directory path to include/cfg/ and etc.

For example, something like that:

const WWW_DIR_INC := ":www:registration";

I hope for your support and joint development!

With best regards, Harley!

Re: [const] Directory

Posted: Sat Mar 16, 2019 7:58 pm
by Yukiko
If this is a feature request I do not understand. You can define a constant like that in your scripts. Maybe I am missing something.

Re: [const] Directory

Posted: Sun Mar 17, 2019 3:47 am
by Harley
Yukiko wrote: Sat Mar 16, 2019 7:58 pm If this is a feature request I do not understand. You can define a constant like that in your scripts. Maybe I am missing something.
Yukiko, yesterday I tried to make one include which contain all info for my server directories. And when I compiled script, I got error!
I maked inc with them, for example:

Code: Select all

const DIR_GDFI     :=  ":Lib:inc_public/GetDataFileInfo";
After it, I include this constants file and use one of my constants, that have a directory:

Code: Select all

include ":Lib:const_public/shard-consts";
include DIR_GDFI;
And compiled script:
Unable to read include file '.../pkg/player/login/inc_public/DIR_GDFI.inc'
Compilation failed.
After that, I thought about new feature for all of us. :grouphug:

Re: [const] Directory

Posted: Sun Mar 17, 2019 10:28 am
by Yukiko
Ah. Now I understand. You want to use a string constant as part of the include statement. This is interesting but I am not sure it is possible currently because of the way eCompile works.

Re: [const] Directory

Posted: Sun Mar 17, 2019 5:20 pm
by Harley
Yukiko wrote: Sun Mar 17, 2019 10:28 am Ah. Now I understand. You want to use a string constant as part of the include statement. This is interesting but I am not sure it is possible currently because of the way eCompile works.
Yep! Thank you for retranslate my thoughts. Its some difficult to find needed words at 03:00 AM ))

I think this thing will make easily understanding and connection for programming and make workspace more clear.

Re: [const] Directory

Posted: Sun Mar 17, 2019 9:20 pm
by CWO
This won't work. eCompile grabs the includes before assigning constants for the very reason that includes can contain constants. It doesn't go through includes one at a time and assign the constants since it needs to know all of the functions and constants available to it before it begins to process the output to the ecl.

Re: [const] Directory

Posted: Sun Mar 17, 2019 11:06 pm
by DevGIB
It resolves the constant though it just doesn't parse it correctly as it appears to drop the package location?

Re: [const] Directory

Posted: Mon Mar 18, 2019 12:15 am
by Yukiko
Though I admit I have limited knowledge of programming languages, I am not aware of any language that allows this, no compiled language anyway.