Mat Posted April 14, 2012 Posted April 14, 2012 Eventually we can modify the functions to accept the reference, yes. Right now, no, it's not implemented.Of course identical behaviour could be provided by an implicit conversion to a string (not necessarily a good idea). Which reminds me:Will `String(MyFunc) = "MyFunc"`? AutoIt Project Listing
jvanegmond Posted April 14, 2012 Posted April 14, 2012 Mat if you want that then you could also let Call accept function pointer as first param. $f = SomeFunc Call($f) github.com/jvanegmond
trancexx Posted April 14, 2012 Posted April 14, 2012 (edited) Of course identical behaviour could be provided by an implicit conversion to a string (not necessarily a good idea). Which reminds me:Will `String(MyFunc) = "MyFunc"`?No. There will be no such association.Somebody list all built-in functions that accept the name of user function. We can add that.edit: in the meantime I'll add it for DllCallbackRegister. Edited April 14, 2012 by trancexx ♡♡♡ . eMyvnE
Valik Posted April 14, 2012 Author Posted April 14, 2012 (edited) Off the top of my head and probably missing something:HotKeySet - Passing Null should unset if it doesn't already.GUICtrlSetOnEventGUIRegisterMsgGUISetOnEventOnAutoItExitRegisterOnAutoItExitUnRegisterDllCallbackRegisterTraySetOnEventTrayItemSetOnEventAdlibRegisterAdlibUnRegisterCallGUICtrlRegisterListViewSortObjEventEdit: I ended up looking through the function reference list and those are the ones I spotted off-hand. Might have missed one or two. Edited April 14, 2012 by Valik
Mat Posted April 14, 2012 Posted April 14, 2012 UDF functions may also need to be looked at. Can't think of any off the top of my head. Ok. Last two questions I promise . Will the be an IsFunc function, and will function pointers be comparable (obviously only (in)equality would work)? These really are some huge improvements to AutoIt. Thanks Trancexx. AutoIt Project Listing
trancexx Posted April 14, 2012 Posted April 14, 2012 Ok. Last two questions I promise . Will the be an IsFunc function, and will function pointers be comparable (obviously only (in)equality would work)?Yes to all. In fact that reminded me to change something to something else.These really are some huge improvements to AutoIt. Thanks Trancexx.Say that when you'd be sure. ♡♡♡ . eMyvnE
Zedna Posted April 14, 2012 Posted April 14, 2012 (edited) Maybe also Execute() should be revieved if it's not affected and maybe also Assign(), Eval(), IsDeclared() but these are for variables not functions and maybe also Ptr(), IsPtr() EDIT: as about UDFs _IEErrorHandlerRegister([$s_functionName = "__IEInternalErrorHandler"]) _WordErrorHandlerRegister([$s_functionName = "__WordInternalErrorHandler"]) _FTP_SetStatusCallback($l_InternetSession, $sFunctionName) - OK _GUICtrlListView_RegisterSortCallBack($hWnd, $fNumbers = True, $fArrows = True) - OK _SQLite_Exec($hDB, $sSQL, $sCallBack = "") + _SQLite_GetTable2d() - OK? --> all COM error handlers will be affected Edited April 14, 2012 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
Valik Posted April 14, 2012 Author Posted April 14, 2012 --> all COM error handlers will be affectedAffected implies the work she is doing cause any difference to existing code. It does not. These new features are optional and do not have an impact on how current code behaves. UDFs do not need updated although they can be and maybe will be at some point in the future. They will continue to work as-is, though.
Valik Posted April 15, 2012 Author Posted April 15, 2012 Just a small update. I know some of you are eager to try out the new stuff. Right now trancexx is still working on a few things to get it as ready as we feel it should be before you guys get to break it. I also have a few things I need to sort out.I might do an alpha release or something just to get it out there. It won't be an official beta release. If I decide to do this I'll just upload the SFX or something (no installer). We'll see. I need a couple days to think through some stuff and as I mentioned, trancexx needs a little more time to finish putting a bit of polish on stuff.
Valik Posted April 17, 2012 Author Posted April 17, 2012 Special Note: This is an alpha release. No installer is provided for this release, only the stand-alone SFX archive. This alpha release contains a couple major changes to the language which can radically change the way scripts are written. The highlights are:The $ in variables is now optional. If you want to continue using $ to prefix your variables that is fine and will continue to be supported. If you'd rather drop the $ that is fine, too, though be aware you cannot have variables with the same name as functions unless you prefix the variable with $.Functions are now first class objects. That means you can assign a function to a variable an invoke that function through the variable. It is similar in behavior to function pointers. This is very useful for callbacks as well as writing interfaces that are decoupled from their implementation.3.3.9.5 (17th April, 2012) (Alpha)AutoIt:- Added: Empty arrays.- Added: Functions are now first class objects which means variables can "point" to them and the function can be called through the variable.- Added: The $ prefix for variables is now optional and can be omitted entirely.- Added: Built-in functions that take a callback now be passed directly in addition to the old method of passing as a string. Built-in functions can also be passed now (be careful that the function you pass matches what the caller expects).- Fixed: Redim allows initialization to non-array.- Fixed #2166: StringToASCIIArray() and StringFromASCIIArray() did not correctly return an empty string when the start index is greater than the end index.- Changed: Optional square brackets for array declaration with initialization.Au3Check:- Changed: Optional square brackets for array declaration with initialization.The following changes are script breaking changes:None so far.NOTE: WinAPIEx is included in this release. The files exist but there are no documentation or examples. Filenames and functions are subject to change or removal. Functions will be moved out to other files before the final release and the file WinAPIEx.au3 will likely not exist when that happens.Report issues here.Download here. Mat and jaberwacky 2
guinness Posted April 17, 2012 Posted April 17, 2012 The example compiles with the Alpha version and runs too, but fails when using Au3Check V3.3.9.5."C:UsersPCDesktopTest.au3"(3,7) : error: syntax errorLocal Writer 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
Valik Posted April 17, 2012 Author Posted April 17, 2012 Au3Check does not support the new syntax changes.
Skitty Posted April 17, 2012 Posted April 17, 2012 The example compiles with the Alpha version and runs too, but fails when using Au3Check V3.3.9.5.I was just taking notice to this, seems as support for proper error checking regarding the latest changes has not yet been implemented.I guess this is why it's an alpha.
guinness Posted April 17, 2012 Posted April 17, 2012 (edited) Au3Check does not support the new syntax changes.OK, noted.Wrapper directive to turn off Au3Check.#AutoIt3Wrapper_Run_AU3Check=N Edited April 17, 2012 by guinness 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
ProgAndy Posted April 17, 2012 Posted April 17, 2012 Thanks for the alpha. I just found a bug: You can assign a function to a COM variant, but AutoIt crashes when reading it. $o = ObjCreate("Scripting.Dictionary") If @error Then Exit ConsoleWrite("Created Ductionary" & @LF) $o("test") = myfun If @error Then Exit ConsoleWrite("Set function to dictionary value" & @LF) objfun = $o("test") ConsoleWrite("Read function from dictionary value" & @LF) Func myfun() MsgBox(0, "", "WORKS!") EndFunc *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
Valik Posted April 17, 2012 Author Posted April 17, 2012 Why would you even...? Never mind. I don't want to know. jvanegmond and James 2
ProgAndy Posted April 17, 2012 Posted April 17, 2012 (edited) Why would you even...? Never mind. I don't want to know. Curiosity. I tried to test all possible ways to use a function reference. Here is another one that errors out: Global $array = [myfunc] $array[0]() Func myfunc() MsgBox(0, "", "WORKS") EndFunc Edited April 17, 2012 by ProgAndy *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
Valik Posted April 17, 2012 Author Posted April 17, 2012 That one should work. Just an oversight, probably.
ProgAndy Posted April 17, 2012 Posted April 17, 2012 Those new variable names are pretty interesting: - You can override UDFs. (or use the name as a "normal" variable) If you do it globally there is no way to get the original function back. - You cannot override native functions (you can still use the name for a "normal" variable, no function reference) *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
jvanegmond Posted April 17, 2012 Posted April 17, 2012 Those new variable names are pretty interesting:- You cannot override native functions (you can still use the name for a "normal" variable, no function reference)This is probably because the names of native functions are preprogrammed in the lexer. If I recall correctly. (If that's the case then) that should be easily adjusted. github.com/jvanegmond
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