simple syntax error

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

simple syntax error

jon_bondy

I can't see the problem.  I'm trying to use a boolean to control which pair of STL files I import, but neither the ? nor the if conditionals are accepted.  What am I missing?  I keep getting this:


Parsing design (AST generation)...

Saved backup file: C:/Users/jon/Documents/OpenSCAD/backups/Hollow Face Array for CNC 2-backup-PJfjlBZf.scad

ERROR: Parser error: syntax error, in file Hollow Face Array for CNC 2.scad, line 25 

Execution aborted




// faces are about 114 x 76 x 13
isOSCAD = true;

module PFaceA()
    translate([11, 90, 0])
        rotate([90, 0, 180])
            import("d:/stl files/Face-Plate-POS-1-decimatedx2.off", convexity = 1000);

module PFaceO()
    translate([11, 90, 0])
        rotate([90, 0, 180])
            import("d:/stl files/Face-Plate-POS-1.stl", convexity = 1000);

module NFaceA()
    translate([11, 90, 13])
        rotate([90, 0, 180])
            import("d:/stl files/Face-Plate-NEG-1-decimatedx2.off", convexity = 1000);

module NFaceO()
    translate([11, 90, 13])
        rotate([90, 0, 180])
            import("d:/stl files/Face-Plate-NEG-1.stl", convexity = 1000);

module PFace()
    if (isOSCAD) then PFaceO(); else PFaceA();
   
module NFace()
    isOSCAD ? NFaceO() : NFaceA();


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: simple syntax error

nophead
then

On Mon, 7 Dec 2020 at 14:08, jon <[hidden email]> wrote:

I can't see the problem.  I'm trying to use a boolean to control which pair of STL files I import, but neither the ? nor the if conditionals are accepted.  What am I missing?  I keep getting this:


Parsing design (AST generation)...

Saved backup file: C:/Users/jon/Documents/OpenSCAD/backups/Hollow Face Array for CNC 2-backup-PJfjlBZf.scad

ERROR: Parser error: syntax error, in file Hollow Face Array for CNC 2.scad, line 25 

Execution aborted




// faces are about 114 x 76 x 13
isOSCAD = true;

module PFaceA()
    translate([11, 90, 0])
        rotate([90, 0, 180])
            import("d:/stl files/Face-Plate-POS-1-decimatedx2.off", convexity = 1000);

module PFaceO()
    translate([11, 90, 0])
        rotate([90, 0, 180])
            import("d:/stl files/Face-Plate-POS-1.stl", convexity = 1000);

module NFaceA()
    translate([11, 90, 13])
        rotate([90, 0, 180])
            import("d:/stl files/Face-Plate-NEG-1-decimatedx2.off", convexity = 1000);

module NFaceO()
    translate([11, 90, 13])
        rotate([90, 0, 180])
            import("d:/stl files/Face-Plate-NEG-1.stl", convexity = 1000);

module PFace()
    if (isOSCAD) then PFaceO(); else PFaceA();
   
module NFace()
    isOSCAD ? NFaceO() : NFaceA();

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: simple syntax error

jon_bondy

Thanks.  I know too many frigging languages.  Sigh


On 12/7/2020 9:14 AM, nop head wrote:
then

On Mon, 7 Dec 2020 at 14:08, jon <[hidden email]> wrote:

I can't see the problem.  I'm trying to use a boolean to control which pair of STL files I import, but neither the ? nor the if conditionals are accepted.  What am I missing?  I keep getting this:


Parsing design (AST generation)...

Saved backup file: C:/Users/jon/Documents/OpenSCAD/backups/Hollow Face Array for CNC 2-backup-PJfjlBZf.scad

ERROR: Parser error: syntax error, in file Hollow Face Array for CNC 2.scad, line 25 

Execution aborted




// faces are about 114 x 76 x 13
isOSCAD = true;

module PFaceA()
    translate([11, 90, 0])
        rotate([90, 0, 180])
            import("d:/stl files/Face-Plate-POS-1-decimatedx2.off", convexity = 1000);

module PFaceO()
    translate([11, 90, 0])
        rotate([90, 0, 180])
            import("d:/stl files/Face-Plate-POS-1.stl", convexity = 1000);

module NFaceA()
    translate([11, 90, 13])
        rotate([90, 0, 180])
            import("d:/stl files/Face-Plate-NEG-1-decimatedx2.off", convexity = 1000);

module NFaceO()
    translate([11, 90, 13])
        rotate([90, 0, 180])
            import("d:/stl files/Face-Plate-NEG-1.stl", convexity = 1000);

module PFace()
    if (isOSCAD) then PFaceO(); else PFaceA();
   
module NFace()
    isOSCAD ? NFaceO() : NFaceA();

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: simple syntax error

MichaelAtOz
Administrator
In reply to this post by jon_bondy
Also note the conditional '... ? ... : ...' is part of an expression.
Whereas if/else are statements.



-----
OpenSCAD Admin - email* me if you need anything,  or if I've done something stupid...

* on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
* on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain;
to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.