![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Thorsten Froehlich
Subject: Re: Passing file handles to macros - how?
Date: 22 Apr 2003 07:16:30
Message: <3ea5248e$1@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <1ev9avov9b6hkd269fm74okpsdfq31kpg1@4ax.com> , Peter Popov
<pet### [at] vip bg> wrote:
> My question is: can I pass file handles as parameters to macros, and
> if yes, how?
No, because you cannot make copies of file handles for obvious reasons.
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Tue, 22 Apr 2003 13:16:31 +0200, "Thorsten Froehlich"
<tho### [at] trf de> wrote:
>No, because you cannot make copies of file handles for obvious reasons.
But you can make references to them, right?
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vip bg
TAG e-mail : pet### [at] tag povray org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Tue, 22 Apr 2003 13:16:16 +0300, Peter Popov <pet### [at] vip bg> wrote:
> > I have no idea but I imagine you can workaround it with passing it as string and
> > Parse_String() macro.
>
> In this case the file handle should be global, which doesn't help
> much.
You mean this working workaround does not help you ?
#include "strings.inc"
#macro Write(File_Handle)
#write( Parse_String(File_Handle) , "test")
#end
#fopen ID1 "test1.txt" write
Write("ID1")
#fclose ID1
#fopen ID2 "test2.txt" write
Write("ID2")
#fclose ID2
ABX
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Tue, 22 Apr 2003 13:37:15 +0200, ABX <abx### [at] abx art pl> wrote:
>You mean this working workaround does not help you ?
I have to see. In your case it works. In my case, the file handle is
created within a macro which in turn has to pass it to other macros,
so I have to check the scope with which it is created.
In the meanwhile, I am already rendering with the ugliest workaround
possible -- I played parser and pasted the macro code with the
necessary parameters substituted, heh :)
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vip bg
TAG e-mail : pet### [at] tag povray org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <3ea5248e$1@news.povray.org>,
"Thorsten Froehlich" <tho### [at] trf de> wrote:
> > My question is: can I pass file handles as parameters to macros, and
> > if yes, how?
>
> No, because you cannot make copies of file handles for obvious reasons.
Yes, but macro parameters otherwise appear to be handled as references.
There shouldn't be any copying necessary, and this would be a very
useful feature.
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tag povray org
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Thorsten Froehlich
Subject: Re: Passing file handles to macros - how?
Date: 24 Apr 2003 03:49:18
Message: <3ea796fe$1@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <cja### [at] netplex aussie org> ,
Christopher James Huff <cja### [at] earthlink net> wrote:
> Yes, but macro parameters otherwise appear to be handled as references.
> There shouldn't be any copying necessary, and this would be a very
> useful feature.
No, parameters can be passed by value or reference, which is for regular
variables determined automatically. But it cannot be done for file handles
because that would require to support for either copying file handles or
supporting counted references to file handles.
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Thorsten Froehlich <tho### [at] trf de> wrote:
> supporting counted references to file handles.
This shouldn't be difficult. At least not in C++.
--
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}// - Warp -
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Thorsten Froehlich
Subject: Re: Passing file handles to macros - how?
Date: 24 Apr 2003 06:43:01
Message: <3ea7bfb5$1@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <3ea7bdb0@news.povray.org> , Warp <war### [at] tag povray org> wrote:
>> supporting counted references to file handles.
>
> This shouldn't be difficult. At least not in C++.
Of course, but I don't what to get a load of STL into 3.5. The tiny little
<algorithm> already caused some problems because there are enough completely
outdated compiler installs out there that still use ancient broken pre-ARM
C++ compilers and libraries :-(
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <3ea7bfb5$1@news.povray.org>,
"Thorsten Froehlich" <tho### [at] trf de> wrote:
> Of course, but I don't what to get a load of STL into 3.5. The tiny little
> <algorithm> already caused some problems because there are enough completely
> outdated compiler installs out there that still use ancient broken pre-ARM
> C++ compilers and libraries :-(
What do you need the STL for? Reference counting is trivial to
implement. I'm not sure what use it would be for this though...if a file
is closed inside a macro, it will still be invalid, even if there are
still references to it. And how could it be destroyed while in use by a
macro?
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tag povray org
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Thorsten Froehlich
Subject: Re: Passing file handles to macros - how?
Date: 24 Apr 2003 11:01:58
Message: <3ea7fc66$1@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <cja### [at] netplex aussie org> ,
Christopher James Huff <cja### [at] earthlink net> wrote:
> What do you need the STL for? Reference counting is trivial to
> implement.
Yes, reinvent the wheel. And then try to add it in a clean manner in
POV-Ray. The problem of not being able to use "real" classes as members of
most data structures makes it a real hassle. It is about getting a clean
well-working implementation. It isn't about "Reference counting is trivial
to implement." at all.
> I'm not sure what use it would be for this though...if a file
> is closed inside a macro, it will still be invalid, even if there are
> still references to it. And how could it be destroyed while in use by a
> macro?
It could be closed, couldn't it? So what happens if you close it inside the
macro and the try to use it after the macro returns? You run into tons of
problems due to the current structure of the code, and you should have an
idea how many there are given that you have had a look at the source code
before...
Thorsten
____________________________________________________
Thorsten Froehlich
e-mail: mac### [at] povray org
I am a member of the POV-Ray Team.
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |