POV-Ray : Newsgroups : povray.beta-test : #error bug : Re: #error bug Server Time
30 Jul 2024 22:28:12 EDT (-0400)
  Re: #error bug  
From: Warp
Date: 21 Oct 2001 04:34:01
Message: <3bd28879@news.povray.org>
About this discussion about the #error directive:

  Also I think that POV-Ray should print the string given to #error.

  Suppose that you have a macro like this, which takes a parameter which
should be a float value which is >=0 and <1:

#macro FancyMacro(Value)
  #if(Value<0 | Value>=1)
    #error concat("In FancyMacro(): Given parameter value ",
                  str(Value,0,-1),
                  " is out of range.\n")
  #end
  
  // Do something fancy here
#end

  And now suppose that you make a slight mistake when calling it:

#declare Ind = 0;
#while(Ind <= 10)
  FancyMacro(Ind/10)
  #declare Ind = Ind+1;
#end

  Now, which error message is clearer, the one POV-Ray currently gives:


File: C:\somepath\somefile.pov  Line: 5
                  str(Value,0,-1),

                  " is out of range.\n") <----ERROR

Parse Error: User error directive hit.


or what POV-Ray *should* print:


File: C:\somepath\somefile.pov  Line: 5

In FancyMacro(): Given parameter value 1 is out of range.

Parse Error: User error directive hit.


  And this does not look like an error message given by POV-Ray itself.

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

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