|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I am importing, from a generic database, a very large number of items into
an include list.
The items will be classed as possibly 100 distinctly different 'objects',
not all of which will be predefined during the initial display.
When the items are parsed I want a non-defined item to be simply ignored.
I could of course provide an #ifdef....#end around each and every item but I
wonder if there is an easier way, possibly through a macro, to do the job.
David
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I don't think it's possible with a macro. Something like this will not work:
#macro Item(name)
#ifdef(name)
do_whatever_with name
#end
#end
because 'name' _is_ always defined in the context of the macro.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Nieminen Juha" <war### [at] sarakerttunencstutfi> wrote in message
news:38c6179a@news.povray.org...
> I don't think it's possible with a macro. Something like this will not
work:
>
> #macro Item(name)
> #ifdef(name)
> do_whatever_with name
> #end
> #end
>
> because 'name' _is_ always defined in the context of the macro.
Also, I think calling Item(Name) will cause an error if Name is undefined.
The only legal use of an undefined name I can think of are (1) define it
(with #declare or #local or #macro) and (2) check its "existence"
(definess?) with ifdef / ifndef.
Philippe
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Tue, 7 Mar 2000 14:42:02 -0800, David Vincent-Jones wrote:
>I am importing, from a generic database, a very large number of items into
>an include list.
>
>The items will be classed as possibly 100 distinctly different 'objects',
>not all of which will be predefined during the initial display.
Are the 'objects' such that they can be stored in an array? If so, MegaPOV
has an extension to the syntax that allows you to check whether a particular
array element is defined, so you could do whatever you're doing inside a loop
or by passing the array and an index to a macro.
--
These are my opinions. I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |