POV-Ray : Newsgroups : povray.advanced-users : No semicolon allowed in Tuple-style assignments? : Re: No semicolon allowed in Tuple-style assignments? Server Time
23 Feb 2024 14:02:50 EST (-0500)
  Re: No semicolon allowed in Tuple-style assignments?  
From: jr
Date: 26 Mar 2023 22:30:00
Message: <web.6420ff1417acbde34301edef6cde94f1@news.povray.org>

"Bald Eagle" <cre### [at] netscapenet> wrote:
> ....
> I got the ole' can't assign an unidentified something or other to Lvalue...
> The macro has 2 lines.
> #local Result = array {Val1, Val2};
> Result
> But somehow it thinks Result hasn't been defined.
> So I deleted the #local and the Result, and just left the array.
> Works fine now.
> I don't get it.

#version 3.8;
global_settings {assumed_gamma 1}
box {0,1}

#macro has2lines ()
  #local Result = array {1234,5678};
  (Result[0], Result[1])

#declare (first,second) = has2lines();
#debug concat("first ",str(first,0,0)," second ",str(second,0,0),"\n")
#warning "end-of-scene"

note (a) you need to provide two return values if you want to assign two values
from the call, and (b) nothing doing w/out parentheses.  (and coffee !! :-))

regards, jr.

Post a reply to this message

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