Michel Claveau Posted July 10, 2009 Share Posted July 10, 2009 (edited) Hi! I try to do a closure. Here, my code: Func coef($c) Func valeur($v) Return $v*$c EndFunc Return valeur EndFunc $a=coef(1.25) ConsoleWrite($a(1)) ConsoleWrite($a(2)) ConsoleWrite($a(100)) But, I have a syntax error on: Func valeur($v) What is the problem? Thank you for all answers. Edited July 10, 2009 by Michel Claveau Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 10, 2009 Share Posted July 10, 2009 HI, Func in a another Func is not possible. Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Michel Claveau Posted July 10, 2009 Author Share Posted July 10, 2009 Re!Func in a another Func is not possible.Want you said: "...is not possible ...with (pure) AutoIt"?@+MCI Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 10, 2009 Share Posted July 10, 2009 (edited) Hi, what do you want to do? Calculating what? ConsoleWrite(coef(1, 1.25) & @CRLF) ConsoleWrite(coef(2, 1.25) & @CRLF) ConsoleWrite(coef(100, 1.25) & @CRLF) Func coef($valeur, $c) Return $valeur ^ $c EndFunc ;==>coef Mega Edited July 10, 2009 by Xenobiologist Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Michel Claveau Posted July 10, 2009 Author Share Posted July 10, 2009 (edited) Re!A closure can emulate a global variable with a (func)local variable.This tech give a better source-code.See: wikipedia Edited July 10, 2009 by Michel Claveau Link to comment Share on other sites More sharing options...
James Posted July 10, 2009 Share Posted July 10, 2009 Closures are not possible in AutoIt, end of. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 10, 2009 Share Posted July 10, 2009 Hi, which pro do you miss? A closure is only a code block which can be a parameter for a function/method. Or what feature is it that makes them interesting for you? Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now