OpenSCAD demo showing scope of variable in modules / functions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo = 0; | |
echo(foo); | |
m1(); | |
m2(); | |
m1(); | |
echo(foo); | |
module m1() { | |
foo = 1; | |
echo(foo); | |
} | |
module m2() { | |
foo = 2; | |
echo(foo); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment