POV-Ray : Newsgroups : povray.programming : Parsing optional float parameter? : Re: Parsing optional float parameter? Server Time
28 Jul 2024 14:26:08 EDT (-0400)
  Re: Parsing optional float parameter?  
From: Chris Huff
Date: 8 Dec 2000 09:16:58
Message: <chrishuff-486751.09174808122000@news.povray.org>
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...

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

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