Created
August 23, 2017 06:13
-
-
Save bitinn/b2e32975e2b39a08d58c4d5758d22e94 to your computer and use it in GitHub Desktop.
TestScriptNoLocalVar.mel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// REMEMBER TO SOURCE THIS, NOT RUN IN THE SCRIPT EDITOR DIRECTLY | |
{ | |
proc string GetTestString () { | |
return "TEST_STRING_#"; | |
} | |
proc RunLocal1 () { | |
print(GetTestString()); | |
} | |
proc RunLocal2 (string $Input) { | |
print($Input); | |
} | |
proc RunLocal3 () { | |
RunLocal2(GetTestString()); | |
} | |
global proc RunGlobal () { | |
// works | |
print (GetTestString()); | |
// works | |
RunLocal1(); | |
// works | |
RunLocal2(GetTestString()); | |
// works | |
RunLocal3(); | |
} | |
global proc CreateWindow () { | |
if (`window -exists "TestWindow"`) { | |
deleteUI "TestWindow"; | |
} | |
window | |
-title "Test" | |
-sizeable 0 | |
-maximizeButton 0 | |
-widthHeight 200 100 | |
"TestWindow"; | |
string $TestButtons = `frameLayout | |
-collapsable 0 | |
-labelVisible 0 | |
"TestButtons"`; | |
rowColumnLayout -numberOfRows 1; | |
button | |
-label "Quick Test" | |
-command "RunGlobal"; | |
showWindow "TestWindow"; | |
} | |
CreateWindow(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment