POV-Ray : Newsgroups : povray.general : syntax error with macro : syntax error with macro Server Time
29 Jul 2024 14:20:18 EDT (-0400)
  syntax error with macro  
From: kurtz le pirate
Date: 2 May 2011 10:05:09
Message: <kurtzlepirate-BD0D5F.16050802052011@news.povray.org>
hello,

i have this simple macro :

#macro lineEquation (x1,z1,x2,z2)
  #local det = x1-x2;
  #if(det=0)
    #error "\n\n---\nWarning, the system has no unique 
solution.\nProgram stop here\n\n"
  #else
    #local det_a = z1-z2;
    #local det_b = (x1*z2)-(z1*x2);
    <det_a/det, det_b/det, 0>
  #end
#end


i call this with this syntax :

#declare sidesLines[0][0] = 
lineEquation(rectangles[0][0].x,rectangles[0][0].z,rectangles[0][1].x,rec
tangles[0][1].z); // with ';' at the end of the line.


arrays "rectangles" and "sidesLines" are defined in this way :

#declare nbRect=1;
#declare rectangles = array[nbRect][4];
#declare sidesLines = array[nbRect][4];



when i run my script, i get this error :

File Context (5 lines):
  #else
    #local det_a = z1-z2;
    #local det_b = (x1*z2)-(z1*x2);
    <det_a/det, det_b/det, 0>
  #
Parse Error: All #declares of float, vector, and color require 
semi-colon ';' at end if the language version is set to
 3.5 or higher. Either add the semi-colon or set the language version to 
3.1 or lower.



where is my mistake ?

-- 
klp


Post a reply to this message

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