POV-Ray : Newsgroups : povray.general : Break out of a macro? Server Time
1 Nov 2024 13:19:50 EDT (-0400)
  Break out of a macro? (Message 1 to 5 of 5)  
From: Mike Horvath
Subject: Break out of a macro?
Date: 31 Jan 2016 17:02:27
Message: <56ae8473@news.povray.org>
Let's say that based on a condition inside Macro A, I want to 
immediately switch over to Macro B instead without processing the rest 
of Macro A. How do I do this in POV-Ray? In a normal scripting language 
I would simply use a return statement to stop Macro A, but POV-Ray 
doesn't have a return statement.


Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: Break out of a macro?
Date: 31 Jan 2016 17:05:56
Message: <56ae8544$1@news.povray.org>
On 1/31/2016 5:02 PM, Mike Horvath wrote:
> Let's say that based on a condition inside Macro A, I want to
> immediately switch over to Macro B instead without processing the rest
> of Macro A. How do I do this in POV-Ray? In a normal scripting language
> I would simply use a return statement to stop Macro A, but POV-Ray
> doesn't have a return statement.
>
>
> Mike


Okay, I got lucky and found the description of the #break statement in 
"3.3.2.6.4 The switch, case, range and break Directives".


Mike


Post a reply to this message

From: clipka
Subject: Re: Break out of a macro?
Date: 31 Jan 2016 20:36:52
Message: <56aeb6b4@news.povray.org>
Am 31.01.2016 um 23:05 schrieb Mike Horvath:
> On 1/31/2016 5:02 PM, Mike Horvath wrote:
>> Let's say that based on a condition inside Macro A, I want to
>> immediately switch over to Macro B instead without processing the rest
>> of Macro A. How do I do this in POV-Ray? In a normal scripting language
>> I would simply use a return statement to stop Macro A, but POV-Ray
>> doesn't have a return statement.
>>
>>
>> Mike
> 
> 
> Okay, I got lucky and found the description of the #break statement in
> "3.3.2.6.4 The switch, case, range and break Directives".

To me that sounds less like luck, and more like a case of the document
writer having done his job ;)


Post a reply to this message

From: Kenneth
Subject: Re: Break out of a macro?
Date: 31 Jan 2016 20:55:03
Message: <web.56aebac63b78b4dc33c457550@news.povray.org>
>
> Mike wrote:
>
>
> Okay, I got lucky and found the description of the #break statement in
> "3.3.2.6.4 The switch, case, range and break Directives".
>

Very interesting. I didn't know this was possible 'within' a macro. Good to
know.


Post a reply to this message

From: Mike Horvath
Subject: Re: Break out of a macro?
Date: 31 Jan 2016 20:56:31
Message: <56aebb4f$1@news.povray.org>
On 1/31/2016 8:36 PM, clipka wrote:
> To me that sounds less like luck, and more like a case of the document
> writer having done his job ;)
>

No, I got lucky because I was looking for something unrelated, and just 
happened to glance at the note.


Mike


Post a reply to this message

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