Re: [cc65] ca65 question

From: <silverdr1inet.com.pl>
Date: 2008-01-27 05:32:52
On 2008-01-25, at 17:26, Ullrich von Bassewitz wrote:

>> I would like to define a global string constant, that would become
>> available in all the source files. The obvious way to do is to put it
>> into an include file and include that file into every source. This
>> works but is there maybe a better, more elegant solution to this
>> problem?
>
> What do you mean with a string constant?

f.e.

.define MYSTRING "My string constant"

> If you just want a string in memory

Not really - see above. Judging by how I understand things work in  
there - it may not be possible to do it in more "elegant" way but  
combined with what follows donw - it might eventually not be that bad  
either.

[...]

> You can also use C-like include files (I do that for larger  
> projects). Create
> one include file with all exported identifiers, but use ".global"  
> instead of
> ".export". Then include this file in the module that exports the  
> symbol (but
> omit the .export) and also in all files that want to use the  
> symbols. .global
> will do an .export if the symbol is defined and an .import otherwise.

Hm, that is interesting in any case. So the main difference  
between .global and set of .imports/.exports is that one doesn't have  
to care about whether particular module exports or imports the symbol  
- it just comes out of the context (or rather content) of a particular  
file? Smart indeed, and will certainly come in handy.

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Jan 27 05:32:59 2008

This archive was generated by hypermail 2.1.8 : 2008-01-27 05:33:08 CET