kjactive Posted May 6, 2005 Share Posted May 6, 2005 I was wondering - is there a way to dynamic read how many arguments there is send to a function like a form of args tag or something... kj Au3PP 4.1 - Autoit3 preprocessor, optimize speed, performance to scripts and do executes....[/url]Au3Calibur - Create libraries of commonly used code excerptsWords manipulate UDF, functions that is lent from the rexx language, topics and index file includedCustomDialog UDF to include custom made dialogs like a extended colorpick requester to scripts...[url="ftp://fritidshjemmet.com/Autoit3/SysColor.zip"]SysColor UDF a low level color library to manipulate RGB and Hex values...Shell32 UDF to Automate Windows® operating tasks from native dialog and Wizards browsers... Optimized the CodeWicard with options to generate browser code etc... Link to comment Share on other sites More sharing options...
MHz Posted May 6, 2005 Share Posted May 6, 2005 Do you mean like a Calltip, that informs you of the needed parameters to insert into a function ? Link to comment Share on other sites More sharing options...
CyberSlug Posted May 6, 2005 Share Posted May 6, 2005 Can you give an example what you need to do? Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
kjactive Posted May 6, 2005 Author Share Posted May 6, 2005 (edited) Well that's hard to give an example here but I'll try... Foo('d','da','dad') // call the function with three arguments Func Foo(@args) // the variables get auto initiated as locals as one array with something like @args as a counter... FOR $a = 1 TO @args ConsoleWrite($arg[$a] & @CR) Next EndFunc Something like this, it would be nice not to make an array before but just cast it on to the function and this take care of making these arguments into an array local... I know this is more to expect but... kjactive Edited May 6, 2005 by kjactive Au3PP 4.1 - Autoit3 preprocessor, optimize speed, performance to scripts and do executes....[/url]Au3Calibur - Create libraries of commonly used code excerptsWords manipulate UDF, functions that is lent from the rexx language, topics and index file includedCustomDialog UDF to include custom made dialogs like a extended colorpick requester to scripts...[url="ftp://fritidshjemmet.com/Autoit3/SysColor.zip"]SysColor UDF a low level color library to manipulate RGB and Hex values...Shell32 UDF to Automate Windows® operating tasks from native dialog and Wizards browsers... Optimized the CodeWicard with options to generate browser code etc... Link to comment Share on other sites More sharing options...
MHz Posted May 6, 2005 Share Posted May 6, 2005 Have you looked at the macro: @NumParams Number of parameters used in calling the user function. But the macro does not do the array concept. Func Foo($one, $two, $three) FOR $a = 1 TO @NumParams ConsoleWrite($arg[$a] & @CR) Next EndFunc Link to comment Share on other sites More sharing options...
Nutster Posted May 6, 2005 Share Posted May 6, 2005 (edited) One approach is to pass an array to a function which can have different sizes. Func Max(ByRef $array) Dim $i, $retval If Not IsArray($array) Then return $array ; The only thing, so it must be the largest Endif $retval = $array[0] For $i = 1 to UBound($array)-1 If $retval < $array[$i] Then $retval = $array[$i] Endif Next return $retval EndFunc Edited May 6, 2005 by Nutster David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd... Link to comment Share on other sites More sharing options...
kjactive Posted May 6, 2005 Author Share Posted May 6, 2005 (edited) Well if there is a parameter to scope 'how many arguments send to a function' then it would be easy ( I think ) to do the array concept - wouldn't that be nice and come in handy? kjactive Edited May 6, 2005 by kjactive Au3PP 4.1 - Autoit3 preprocessor, optimize speed, performance to scripts and do executes....[/url]Au3Calibur - Create libraries of commonly used code excerptsWords manipulate UDF, functions that is lent from the rexx language, topics and index file includedCustomDialog UDF to include custom made dialogs like a extended colorpick requester to scripts...[url="ftp://fritidshjemmet.com/Autoit3/SysColor.zip"]SysColor UDF a low level color library to manipulate RGB and Hex values...Shell32 UDF to Automate Windows® operating tasks from native dialog and Wizards browsers... Optimized the CodeWicard with options to generate browser code etc... 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