inlander Posted September 2, 2014 Share Posted September 2, 2014 When using the Local keyword on a variable within a function, such as in the example: Func Example() ; Retrieve the data stored in the clipboard. Local $sData = ClipGet()... EndFunc ;==>Example is this local to the function, or local to the script? If local to the function, how would I declare it local to the script? (I want to check it outside the function.) Can a function return a value, as in most other languages? Also, I am not used to on-the-fly declarations with an assignment. How is a variable explicitly declared? TIA for your help. Inlander Link to comment Share on other sites More sharing options...
Geir1983 Posted September 2, 2014 Share Posted September 2, 2014 Use keyword Return in the function to return a result. Variables decleared inside the function with Local will only exist inside the function. Link to comment Share on other sites More sharing options...
Danyfirex Posted September 2, 2014 Share Posted September 2, 2014 (edited) could be. 1 global $data="" func getdata() $data=clipget endfunc 2 local $data=getdata() func getdata() return=clipget() endfunc 3 also could use byref. Edited September 2, 2014 by Danyfirex Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
jguinch Posted September 2, 2014 Share Posted September 2, 2014 and look at the helpfile : https://www.autoitscript.com/autoit3/docs/keywords/Dim.htm, https://www.autoitscript.com/autoit3/docs/keywords/Func.htm Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF 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