POV-Ray : Newsgroups : povray.general : Macro Initialization? Server Time
10 Aug 2024 11:19:15 EDT (-0400)
  Macro Initialization? (Message 18 to 27 of 27)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: TonyB
Subject: Re: Macro Initialization?
Date: 11 Feb 2000 09:43:43
Message: <38a4201f@news.povray.org>
>DimWitt (3)
>DipShit (2)  <--- hehe...
>DeTwitt (1)
>DickLick (1)  <--- damn...
>DeWittless (1)


I can identify with your problem. I live in a Latin American country, and
"Bennett" has been interpreted (on written documents) in many ways through
my life as well. Here are the most common:

Benneth
Barnett
Bened
Benet
Benete
Penet
Venet
and last but not least: Perez! (only once, so far)

As a matter of fact, they got my last name wrong (Benneth) on the lists of
*all* my professors thoughout my entire 7 years in Instituto Cultural

never able to get past Barnett. I was correcting here the whole year
through, to no avail. In the case of Benete, it usually derives more as it
goes through the system, and by the time I get it back, it has become
Benedete, Beneton, etc.

Oh, and my dad always suffers this problem:

Nombre?
William Bennett
(They write) Benet Williams.

Like nobody has *ever* heard William as a first name, so it *must* be a last
name. :|

And don't even get me started on Mom's name (Ilidia). Nobody has ever
written it the same way twice. *Nobody* So I won't post the list here.


Post a reply to this message

From: Mikael Carneholm
Subject: Re: Macro Initialization?
Date: 11 Feb 2000 10:34:26
Message: <38A42BF8.1F9C0E53@ida.utb.hb.se>
Chris Huff wrote:

> This sounds more like default values for parameters than
> overloading--

You're quite right. I did not read the whole of Bill's post, but replied as
soon as I saw the different declarations of the same macro, assuming he was
asking for overloading. On the other hand, overloaded macros would
definitely be a nice feature. What he is asking for is easiest done by
using an include file, and using #ifndef() in the include file to set
defaults, as Philippe Debar pointed out.

----------------------------------------------------
Mikael Carneholm
Dep. of Computer Science and Business Administration


Personal homage:
http://www.studenter.hb.se/~arch
E-mail:
sa9### [at] idautbhbse


Post a reply to this message

From: David Fontaine
Subject: Re: Macro Initialization?
Date: 11 Feb 2000 17:55:58
Message: <38A49322.34CC89F6@faricy.net>
<simpsons>
"There will be no more mockery of your name, Mr. Glasscock."
</simpsons>

--
___     ______________________________________________________
 | \     |_                 <dav### [at] faricynet> <ICQ 55354965>
 |_/avid |ontaine               http://www.faricy.net/~davidf/

"Sitting on a cornflake, waiting for the van to come" -Beatles


Post a reply to this message

From: Bill DeWitt
Subject: Re: Macro Initialization?
Date: 12 Feb 2000 11:44:35
Message: <38a58df3@news.povray.org>
I haven't tested it yet, but I was just wondering if one could pass the
macro an array that initialized some variables...

"Gail Shaw" <gsh### [at] monotixcoza> wrote in message
news:38a3b9a7@news.povray.org...
>
> >gadget(knobs)
> >gadget(knobs,lights,dials)
> >gadget(dials,dial_light,dial_needle,dial_range)
> >
>
>
> I had a similar problem writing my wall macro.
>
> What I did was to have as macro parameters only those
> fields necessarry. At the beginning of the file with the macro in,
> I declare variables for the optional stuff to a default. The
> user can then redeclare the variables before calling the macro.
>
> eg
>
> // file macro.inc
>
> #declare Var1=0;
>
> #macro ThisandThat(Vara,Varb,varc)
> ....
> // Use var1 somewhere here
> ....
>
> #end
>
> Works fine for me, also solves the problem of not being able to
> remember which parameter comes first.
>
> Gail
> *******************************************************************
> * gsh### [at] monotixcoza              * ERROR: COFFEE.COM not found  *
> * http://www.rucus.ru.ac.za/~gail/ * Insert cup and press any key *
> *******************************************************************
> * Definition of an upgrade: Take the old bugs out, put new ones in*
> *******************************************************************
>
>


Post a reply to this message

From: Peter Popov
Subject: Re: Macro Initialization?
Date: 12 Feb 2000 18:26:01
Message: <feulOCzxtSRUtUzBIanP5JsGtUEN@4ax.com>
On Sat, 12 Feb 2000 11:43:51 -0500, "Bill DeWitt"
<the### [at] earthlinknet> wrote:

>I haven't tested it yet, but I was just wondering if one could pass the
>macro an array that initialized some variables...

You can pass an array but the macro will have to rely on specific
variables being in specific places in this array, so no gain here.


Peter Popov
pet### [at] tagpovrayorg
ICQ: 15002700


Post a reply to this message

From: Chris Colefax
Subject: Re: Macro Initialization?
Date: 13 Feb 2000 01:19:14
Message: <38a64ce2@news.povray.org>
Bill DeWitt <the### [at] earthlinknet> wrote:
> I want to use macros in a way that they probably can't be used. I only ask
> because every time I don't, it turns out that what I want to do is quite
> easy and everyone but me has been doing it all along...
>
> I want to call the macro with only those values that are relevant to it's
> present use. For instance...
>
> gadget(knobs)
> gadget(knobs,lights,dials)
> gadget(dials,dial_light,dial_needle,dial_range)
>
>     ... where everything not specified is assumed. This is because I want
to
> make some macros with a couple dozen possible fields and I don't want to
> have to list every one of them every time.

I had the same problem when I started creating my Spline macro system.  With
my previous (non-macro) include files a set of declarable options worked
well, but it was easy to forget or mistype option variable names, and a
hassle to enter all the #declare ... = ... statements.

If your options are all boolean values then one solution is to code a system
of bitwise operators (as I have in the City Generator).  For more
flexibility, I've created a system for the aforementioned Spline macros
that allows you to specify named options and values, without having to use
any #declare or #local statements.  The technique also catches mistyped
option names as parsing errors, and allows you to specify options ranging
from floats and vectors to objects, pigments, arrays, strings, etc.

If you want to try the technique (and the Spline system), email me for a
copy of the macro file - it's still not finished, but any testing you might
want to do is most appreciated.


Post a reply to this message

From: Bill DeWitt
Subject: Re: Macro Initialization?
Date: 13 Feb 2000 16:52:19
Message: <38a72793@news.povray.org>
"Chris Colefax" <cco### [at] geocitiescom> wrote :
>
> If you want to try the technique (and the Spline system), email me for a
> copy of the macro file - it's still not finished, but any testing you
might
> want to do is most appreciated.
>

    Let's see, do I want a chance to play with an advance copy of a Chris
Colefax Spline system? Let me think about it for a few weeks... YES!


Post a reply to this message

From: David Fontaine
Subject: Re: Macro Initialization?
Date: 13 Feb 2000 17:45:08
Message: <38A73393.5550E791@faricy.net>
I don't know, but macros are a great way to get around the max parameters
thing...

--
___     ______________________________________________________
 | \     |_                 <dav### [at] faricynet> <ICQ 55354965>
 |_/avid |ontaine               http://www.faricy.net/~davidf/

"Sitting on a cornflake, waiting for the van to come" -Beatles


Post a reply to this message

From: Gail Shaw
Subject: Re: Macro Initialization?
Date: 14 Feb 2000 01:37:06
Message: <38a7a292@news.povray.org>
David Fontaine wrote in message <38A73393.5550E791@faricy.net>...
>I don't know, but macros are a great way to get around the max parameters
>thing...
>


What max parameters thing???

Gail
*******************************************************************
* gsh### [at] monotixcoza              * ERROR: COFFEE.COM not found  *
* http://www.rucus.ru.ac.za/~gail/ * Insert cup and press any key *
*******************************************************************
* Definition of an upgrade: Take the old bugs out, put new ones in*
*******************************************************************


Post a reply to this message

From: Margus Ramst
Subject: Re: Macro Initialization?
Date: 14 Feb 2000 16:20:25
Message: <38A8721B.C61391AE@peak.edu.ee>
Gail Shaw wrote:
> 
> What max parameters thing???
> 

If you don't know, you haven't written a real macro yet :)
POV macros can have a maximum of 20 parameters.

Margus


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.