discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

multiline functions

V
vincent_mathoscope
Mon, May 14, 2018 3:24 PM

hi
if my function has several lines
say f(x) is calculated by :

what is the syntax in openscad ?
i dont really understand where to whatch here to have the answer :
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/User-Defined_Functions_and_Modules#Functions

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

hi if my function has several lines say f(x) is calculated by : what is the syntax in openscad ? i dont really understand where to whatch here to have the answer : https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/User-Defined_Functions_and_Modules#Functions -- Sent from: http://forum.openscad.org/
R
Rick
Mon, May 14, 2018 3:43 PM

Your function body didn't make it through.

On Mon, May 14, 2018 at 11:24 AM, vincent_mathoscope <
mathoscope@netcourrier.com> wrote:

hi
if my function has several lines
say f(x) is calculated by :

what is the syntax in openscad ?
i dont really understand where to whatch here to have the answer :
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/User-
Defined_Functions_and_Modules#Functions

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


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

--
"Rumors of my death have been greatly exaggerated."
-- Jesus Christ

Your function body didn't make it through. On Mon, May 14, 2018 at 11:24 AM, vincent_mathoscope < mathoscope@netcourrier.com> wrote: > > hi > if my function has several lines > say f(x) is calculated by : > > what is the syntax in openscad ? > i dont really understand where to whatch here to have the answer : > https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/User- > Defined_Functions_and_Modules#Functions > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > -- "Rumors of my death have been greatly exaggerated." -- Jesus Christ
N
NateTG
Mon, May 14, 2018 4:15 PM

Roughly speaking, the function goes from the spot where you have "function"
until there's a semicolon.

You can check the manual for examples (like the one for quicksort) that
might clarify things.

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

Roughly speaking, the function goes from the spot where you have "function" until there's a semicolon. You can check the manual for examples (like the one for quicksort) that might clarify things. -- Sent from: http://forum.openscad.org/
NH
nop head
Mon, May 14, 2018 4:22 PM

A function in openscad is an expression. That can be as long as you want
but you can't have statements like other languages. You can use let() to
assign sub expressions to variables and ? : to have conditionals.

On 14 May 2018 at 17:15, NateTG nate-openscadforum@pedantic.org wrote:

Roughly speaking, the function goes from the spot where you have "function"
until there's a semicolon.

You can check the manual for examples (like the one for quicksort) that
might clarify things.

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


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

A function in openscad is an expression. That can be as long as you want but you can't have statements like other languages. You can use let() to assign sub expressions to variables and ? : to have conditionals. On 14 May 2018 at 17:15, NateTG <nate-openscadforum@pedantic.org> wrote: > Roughly speaking, the function goes from the spot where you have "function" > until there's a semicolon. > > > You can check the manual for examples (like the one for quicksort) that > might clarify things. > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >