POV-Ray : Newsgroups : povray.general : Passing file handles to macros : Re: Passing file handles to macros Server Time
19 Nov 2024 01:24:55 EST (-0500)
  Re: Passing file handles to macros  
From: John VanSickle
Date: 27 May 2002 10:29:49
Message: <3cf242dd@news.povray.org>
"Slime" <slm### [at] slimelandcom> wrote in message
news:3cf13aae$1@news.povray.org...
> > > Did this in effect mean that you couldn't open a filehandle outside a
> > macro
> > > and then write to the filehandle inside the macro?
> >
> > Yes.
>
>
> Well... I may be mistaken, but I believe this works:
>
> #macro dostuff()
> #write(MYFILE, "hi")
> #end
>
> #fopen MYFILE "myfile.txt" write
> dostuff()
> #fclose MYFILE
>
> You just can't pass the actual file handle to the macro, so you have to be
> able to pre-write the macro knowing what the filehandle will be named. A
> significant restriction, yes. Not horrible though.

Yes, unless there is a security problem with allowing handles to be passed
as macro parameters, there is no reason to prohibit it.

Regards,
John


Post a reply to this message

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