|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I was having a bit of trouble with a macro, and learned that file handles
cannot be passed to macros.
As things stand, the only work-around is to pass the file name, and have the
macro open the file, or to specify
a global handle for the macro to use.
Were there any problems encountered with allowing handles to be passed to
macros?
Regards,
John
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
John VanSickle wrote:
> I was having a bit of trouble with a macro, and
> learned that file handles cannot be passed to macros.
>
> As things stand, the only work-around is to pass the
> file name, and have the macro open the file, or to
> specify a global handle for the macro to use.
I also think you could use the parse_string macro in POV-Ray 3.5 to
parse a string containing the file handle name if I have understood your
problem correctly.
Rune
--
3D images and anims, include files, tutorials and more:
Rune's World: http://rsj.mobilixnet.dk (updated May 20)
POV-Ray Users: http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Ring: http://webring.povray.co.uk
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"John VanSickle" <evi### [at] hotmailcom> wrote in message
news:3cef9c2f@news.povray.org...
> I was having a bit of trouble with a macro, and learned that file handles
> cannot be passed to macros.
>
<snip>
Did this in effect mean that you couldn't open a filehandle outside a macro
and then write to the filehandle inside the macro?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Tom Melly" <tom### [at] tomandlucouk> wrote in message
news:3cefeab8@news.povray.org...
> "John VanSickle" <evi### [at] hotmailcom> wrote in message
> news:3cef9c2f@news.povray.org...
> > I was having a bit of trouble with a macro, and learned that file
handles
> > cannot be passed to macros.
>
> <snip>
>
> 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.
Regards,
John
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"John VanSickle" <evi### [at] hotmailcom> wrote in message
news:3cf0fd9d@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.
>
Just checking... that's a bit of a blow. I mean, not insummontable, but a
pain.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> > 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.
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <3cf0fd9d@news.povray.org> , "John VanSickle"
<evi### [at] hotmailcom> wrote:
>> 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.
No!
You just cannot make any copies of file handles and thus you can't pass them
as parameters either.
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Thorsten Froehlich" <tho### [at] trfde> wrote in message
news:3cf15ae8$1@news.povray.org...
> In article <3cf0fd9d@news.povray.org> , "John VanSickle"
> <evi### [at] hotmailcom> wrote:
>
> >> 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.
>
> No!
>
> You just cannot make any copies of file handles and thus you can't pass
them
> as parameters either.
I know that (it's in the docs).
Regards,
John
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"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
|
|
| |
| |
|
|
|
|
| |