|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
When I run:
______________________________________
#version 3.7;
global_settings { assumed_gamma 1 }
#macro Write_something (N, FileID)
#write (FileID, N)
#end
#fopen F "test.txt" write
Write_something ("Hello, world.\n", F)
#fclose F
______________________________________
I get the error:
______________________________________
"C:\Users\Ricky Callwood\Documents\POV-Ray\test\file_param.pov" line 19: Parse
Error: Expected 2 parameters but only 1 found.
______________________________________
I am running POV-Ray version 3.7RC3.
My OS is the infinitely exasperating Windows 7 Ultimate.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> When I run:
>
> #version 3.7;
>
> global_settings { assumed_gamma 1 }
>
> #macro Write_something (N, FileID)
> #write (FileID, N)
> #end
>
> #fopen F "test.txt" write
> Write_something ("Hello, world.\n", F)
> #fclose F
I dunno why, but I cant pass either the fileid as parameter
#version 3.7;
global_settings { assumed_gamma 1 }
#macro Write_something (N)
#write (f,concat(N))
#end
#fopen f "test.txt" write
Write_something ("Hello, world.\n")
I hope to serve this at the moment, removing the fileid parameter
B. Gimeno
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
A variation in which you can enter the output filename as a paremeter.
#macro Write_something (file_name,N)
#fopen F file_name write
#write (F,N)
#fclose F
#end
Write_something ("test.txt","Hello, world.\n")
By the way, is there a powerful and unavoidable reason to introduce as a
parameter the id_file handler?
Regards
B. Gimeno
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"B. Gimeno" <nomail@nomail> wrote:
> By the way, is there a powerful and unavoidable reason to introduce as a
> parameter the id_file handler?
Yes. If the macro is called more than once.
I found a workaround, though.
#macro Write_something (Filename, N)
#fopen F Filename append
#write (F, N)
#fclose F
#end
#declare FILE1 = "test.txt"
#fopen F FILE1 write #fclose F //zero the output file
Write_something (FILE1, "Hello,\n")
Write_something (FILE1, "world.\n")
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|