storme Posted July 31, 2011 Posted July 31, 2011 (edited) G'day AllI've kind of fallen in love with the STATIC keyword.I've used it in a few scripts now and it works really well (now that I understand how it works!)At first glance I thought what will this ever be used for but after playing with it I think it helps enormously with encapsulating UDF variables.However, I'm a little worried about using it because of the warningWarning: This feature is experimental. It may not work, may contain bugs or may be changed or removed without notice.DO NOT REPORT BUGS OR REQUEST NEW FEATURES FOR THIS FEATURE.USE AT YOUR OWN RISK.BUT.... it has been aroudn since "18th December, 2009 - v3.3.2.0" and hasn't been removed...YET...So is a fixture now, are there plans to remove it OR If it isn't a fixture and only "experimental" how long will experiment last for?If it's sticking around I'll start using it.......if it's going I'll go back to global vraiables. Thanks for the answer(s) John Morrison Edited July 31, 2011 by storme Some of my small contributions to AutoIt Browse for Folder Dialog - Automation SysTreeView32 | FileHippo Download and/or retrieve program information | Get installedpath from uninstall key in registry | RoboCopy function John Morrison aka Storm-E
ProgAndy Posted July 31, 2011 Posted July 31, 2011 I see a similarity to the other experimental feature, plugins. The plugin-API has been unchanged since 2007 and never left experimental stage. *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
guinness Posted July 31, 2011 Posted July 31, 2011 I personally use ByRef Or Global in situations where I need to retain a Local variable outside of the Function. I think it's experimental due to the fact it could become messy with debugging the code. Just my 2cents UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
storme Posted July 31, 2011 Author Posted July 31, 2011 I see a similarity to the other experimental feature, plugins. The plugin-API has been unchanged since 2007 and never left experimental stage.But that is the problem. Being around for that long you can "ASS-U-ME" that it's a fixture untill one of the devs decide the experiment is over and he removes it. Though plugin looks like it will be aroudn for ever. Thanks for the advice. Some of my small contributions to AutoIt Browse for Folder Dialog - Automation SysTreeView32 | FileHippo Download and/or retrieve program information | Get installedpath from uninstall key in registry | RoboCopy function John Morrison aka Storm-E
jvanegmond Posted July 31, 2011 Posted July 31, 2011 Assume that it can break, you can always replace your static variables with global variables. I think a 10 line script could, in fact, do that for you. So go for the new feature, and if it breaks it'll take 10 seconds to "fix it". github.com/jvanegmond
storme Posted July 31, 2011 Author Posted July 31, 2011 I personally use ByRef Or Global in situations where I need to retain a Local variable outside of the Function. I think it's experimental due to the fact it could become messy with debugging the code. Just my 2cents Yes but ByRef and Globals can get messy if the UDF gets complex.Maybe it's it's just me OO traning kicking in that makes me shy away from global variables.Oh and the possibility of using the same global name in multiple UDFs.STATIC means I can hide the variables I want to keep/reuse for that function inside that function.Thanks for the feedback! Some of my small contributions to AutoIt Browse for Folder Dialog - Automation SysTreeView32 | FileHippo Download and/or retrieve program information | Get installedpath from uninstall key in registry | RoboCopy function John Morrison aka Storm-E
MvGulik Posted August 22, 2011 Posted August 22, 2011 (edited) DO NOT REPORT BUGS OR REQUEST NEW FEATURES FOR THIS FEATURE.Mmm. So tracker it out. ... bummer.... Forum not that user friendly when it comes down to tracking down known/potential "Static" issues. ... Edited August 22, 2011 by iEvKI3gv9Wrkd41u "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ...
GEOSoft Posted August 22, 2011 Posted August 22, 2011 (edited) You should find it in Dev chat. As I recall the issues were mainly around using Static with arrays and as a matter of fact I was just asking this very question in a PM a couple of days ago. I do know that the Developer that was working on this hasn't been around in a while and it appears that nobody has picked up where he left off as of yet. EDIT: I also seem to recall a discussion where someone stated to the effect that if Static become problematic it would simply be removed. Edited August 22, 2011 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
MvGulik Posted August 22, 2011 Posted August 22, 2011 Roger. Waiting until 'Static' Development seems to be picked up again. "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ...
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