cross-stack globals, also, file inclusion

J. Landman Gay jacque at
Fri Oct 24 13:16:04 EDT 2003

On 10/24/03 9:52 AM, Rob Cozens wrote:

> I have no doubt this is workable; but I see nothing here to convince me 
> that a cat skinned your way is necessarily better or worse than a cat 
> skinned my way.

Nope. My only point is that there is already a reasonable way to 
implement global constants, and it keeps the language nice and compact. 
As I said before, I have no particular objection to adding global 
constants, I just don't see any reason to.

> Remember, I mentioned "translatable" as well as multi-lingual. 
> Serendipity Library will load message lines in any language from any 
> text file with the correct number of lines.  Serendipity Library keeps 
> only the currently-selected language's text in RAM, and users can edit 
> the message text files directly to customize/translate messages, labels, 
> menuItems, toolTips, etc.

You could as easily load a text file into a global array as you can a 
property set. No difference there, and as you say, it would cut down on 
memory usage. You could probably even use the same text files you are 
using now.

> Give me a better reason to change my approach, and I'll look more deeply 
> into this.

I'm not sure there's a "better" reason -- there is only a "right now" 
reason. What you want to do is available now, is easily implemented, and 
as far as I can see, requires only that you change the parentheses in 
your function calls to square brackets. You can probably even load the 
array from the existing text files on disk, and then need only refer to 
the elements using array notation instead of function notation. Seems to 
me that's the only change you'd need to make to implement global 
constants. Of course, I could be off base; I'm only going on what we've 
talked about here.

So again, I see no particular reason to push for global constants. If 
people really want them, fine, I just don't think they are necessary 
because it is so easy to implement them using the existing syntax.

Jacqueline Landman Gay         |     jacque at
HyperActive Software           |

More information about the Use-livecode mailing list