POV-Ray : Newsgroups : povray.general : funky array thing : Re: funky array thing Server Time
13 Oct 2024 20:03:34 EDT (-0400)
  Re: funky array thing  
From: Leroy
Date: 23 Aug 2024 22:15:00
Message: <web.66c9418a710883073c8d69f0f712fc00@news.povray.org>
Alain Martel <kua### [at] videotronca> wrote:
> > On 2024-08-22 15:53 (-4), Leroy wrote:
> >>
> >> Like this :: #declare Tab=array[4]{ 1 2 3 4 }
> >>
> >> I was going to go back and put commas in but forgot and ran it anyway and It
> >> still worked!
> >>
> >> So I tried ::
> >> #declare Sf=array[4]{"a" "b" "c" "d"}
> >> #declare Sf=array[4]{<1,2,3> <1,2,3> <1,2,3> <1,2,3>}
> >>
> >> They  also worked !
> >
> > Be careful with this.  Don't get burned by a leading '+' or '-'.
> >
> Like this :: #declare Tab=array[4]{ 1 -2 3 -4 }
> That parse as :: #declare Tab=array[4]{ -1, -1, 0, 0 }
> Or this :: #declare Tab=array[4]{ +1 -2 +3 -4 }
> That parse as :: #declare Tab=array[4]{ -2, 0, 0, 0 }

More funk!
I didn't think about trying negative numbers!
Won't be using that little trick for much.
It was just something I wasn't expecting.


Post a reply to this message

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