POV-Ray : Newsgroups : povray.general : how to pass array of values to a macro : Re: how to pass array of values to a macro Server Time
5 Aug 2024 06:16:17 EDT (-0400)
  Re: how to pass array of values to a macro  
From: ingo
Date: 12 Nov 2002 12:48:29
Message: <Xns92C4C0309A268seed7@povray.org>
in news:3dd13a9e$1@news.povray.org Johan Feyaerts wrote:

> I 'd want to pass an array of values to a macro?

#macro NumberItems(Array)
  #local Return=dimension_size(Array,1);
  (Return)  
#end

#declare Arr=array[5]{1,2,3,4,5}

#declare Num=NumberItems(Arr);

#debug str(Num,0,0)

Also look in the docs for "dimension" to figure out the amount of 
dimensions of an array.

Ingo


Post a reply to this message

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