POV-Ray : Newsgroups : povray.general : dynamic memory possible? : Re: dynamic memory possible? Server Time
31 Jul 2024 16:25:56 EDT (-0400)
  Re: dynamic memory possible?  
From: Gunnar
Date: 5 Jun 2007 06:45:02
Message: <web.46653e94752edf44678ea4f80@news.povray.org>
"Gunnar" <nomail@nomail> wrote:
> "Penelope20k" <pen### [at] caramailfr> wrote:
> > ill will do like this
> > I read the data and create an include file containing all My_data[index] =
> > value;
> >
> > then when all the txt file is read, i will declare the size of array and
> > include the .inc file
> >
> > (please correct typo)
> >
> >
> > #declare  convert_file=on;  // switch here if you dont need to convert each
> > time
> >
> >
> > #if(convert_file)
> >     #fopen My_file_ACR "12440_ACR.txt" read
> >     #fopen My_data_ACR "My_Data_ACR.inc"
> >
> >     #declare index=0;
> >     #while(defined(My_file_ACR))
> >         #read (My_file_ACR, a,b,c)
> >         #declare vector=<a,b,c>;
> >         #write (My_Data_ACR,"#declare my_data[",index,"]=",vector,";n")
> >         #declare index=index+1;
> >     #end
> >
> > // close files here
> >
> >
> > #end // end of if statement
> >
> >
> >
> >     #declare my_data=array[index]    // the one resulting of the loop
> >     // then
> >     #include my_data_acr.inc
> >
> >
> >
>
> I will have a try, thanks for the suggestion! Seems to be a nice idea.


Works great after adding a semicolon here and a "write" there. Thanks a
lot!!!


Post a reply to this message

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