Jump to content
Sign in to follow this  
Valik

Latest Beta

Recommended Posts

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"`?

Share this post


Link to post
Share on other sites

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 by trancexx

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Off the top of my head and probably missing something:

  • HotKeySet - Passing Null should unset if it doesn't already.
  • GUICtrlSetOnEvent
  • GUIRegisterMsg
  • GUISetOnEvent
  • OnAutoItExitRegister
  • OnAutoItExitUnRegister
  • DllCallbackRegister
  • TraySetOnEvent
  • TrayItemSetOnEvent
  • AdlibRegister
  • AdlibUnRegister
  • Call
  • GUICtrlRegisterListViewSort
  • ObjEvent
Edit: 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 by Valik

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 by Zedna

Share this post


Link to post
Share on other sites

--> all COM error handlers will be affected

Affected 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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 error

Local 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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Au3Check does not support the new syntax changes.

OK, noted.

Wrapper directive to turn off Au3Check.

#AutoIt3Wrapper_Run_AU3Check=N

Edited 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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...