POV-Ray : Newsgroups : povray.programming : Parsing optional float parameter? : Re: Parsing optional float parameter? Server Time
28 Jul 2024 14:31:15 EDT (-0400)
  Re: Parsing optional float parameter?  
From: Ron Parker
Date: 8 Dec 2000 10:29:02
Message: <slrn931vhv.shn.ron.parker@fwi.com>
On Fri, 08 Dec 2000 09:17:48 -0500, Chris Huff wrote:
>In article <3a30dfb5@news.povray.org>, Warp <war### [at] tagpovrayorg> 
>wrote:
>
>Try something like this:
>
>Get_Token();
>if(Token.Token_Id == COMMA_TOKEN)
>{
>    SecondParam = (int)Parse_Float();
>}
>else
>{
>    Unget_Token();
>}
>
>In other words, peek at the next token to see if it is a comma, in which 
>case another parameter has been specified. A more generalized version of 
>this could make a nice macro...

But that would violate the principle that most commas are optional.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

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