Jump to content

Local vars


Recommended Posts

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.
Link to comment
Share on other sites

could be.


global $data=""


func getdata()




local $data=getdata()

func getdata()




also could use byref.

Edited by Danyfirex
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...