Get values from Functions Static Variables

Post your working scripts, libraries and tools
User
Posts: 282
Joined: 26 Jun 2017, 08:12

Get values from Functions Static Variables

12 Jul 2018, 13:54

I saw something identical to this while surfing the internet! (I don't know, I think it may be useful for someone!)

Code: Select all

f("@@@@")

msgbox, % ""
. F({GetVar: "x"}) "`n"
. F({GetVar: "y"}) "`n"
. F({GetVar: "z"}) "`n"
. x " - " y " - " z


F(Options)	;_________________ F (Function) _________________
{
Static x, y, z		;"Static" variables, remember values between function calls 

	if (Options["GetVar"] != "")	;if not blank\empty
	{
	Options := Options["GetVar"]
	return, (%Options%)
	}

x := "xxxxxxxxxxxxx - " Options
y := "yyyyyyyyyyyyy - " Options
z := "zzzzzzzzzzzzz - " Options
}

Return to “Scripts and Functions”

Who is online

Users browsing this forum: nilsonrdg and 45 guests