monoceres Posted May 30, 2008 Share Posted May 30, 2008 I am thinking about adding the idea of monoceres into AutoIt3Wrapper and update a script one time when a directive is specified.I took the original script/idea and created this UDF. Its somewhat faster but could you folfs give it a spin to see if it works as it should be?Directive will be : #AutoIt3Wrapper_Fix_Includes=y Which will be reset to "n"when ran to avoid running it each time. *removed* Seems to work as expected Insane speed btw! It's like 20x faster than mine! Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Developers Jos Posted May 31, 2008 Developers Share Posted May 31, 2008 (edited) Seems to work as expected Insane speed btw! It's like 20x faster than mine!Its the exact same logic as you used but just moved a couple of tests to a more logical place, used RegEx and only one "fileopen - write records - fileclose" to speed it up. I think it makes live a lot easier for many when it runs one time adding the required *constands*.au3 files.Jos Edited May 31, 2008 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
gseller Posted May 31, 2008 Share Posted May 31, 2008 I just made a small "updater" which will search through your scripts and add appropriate includes. Feel free to change it since it's not very optimized and it could have some problems (Tested on one of my old projects with 400+ lines and worked flawless though) #include <Array.au3> #include <File.au3> $script=FileOpenDialog("Choose script that will be fixed",@ScriptDir,"au3 (*.au3)") $autoitdir=FileSelectFolder("Autoit Include folder","") If $autoitdir="" Then Exit If $script="" Then Exit Global $includelines, $scriptdata Global $includestoadd[1], $count=0 $scriptdata=FileRead($script) $includes=_FileListToArray($autoitdir,"*Constants*.au3") For $i=1 To Ubound($includes)-1 _FileReadToArray($autoitdir&"\"&$includes[$i],$includelines) For $j=1 To Ubound($includelines)-1 If StringLeft($includelines[$j],12)="Global Const" Then $const=StringMid($includelines[$j],StringInStr($includelines[$j],"$"),StringInStr($includelines[$j],'=')-StringInStr($includelines[$j],"$")-1) If StringInStr($scriptdata,$const) Then _ArrayAdd($includestoadd,$includes[$i]) ExitLoop EndIf EndIf Next Next For $a=1 To UBound($includestoadd)-1 If StringInStr($scriptdata,"#include <"&$includestoadd[$a]&">")=0 And StringInStr($scriptdata,"#include<"&$includestoadd[$a]&">")=0 And $includestoadd[$a]<>"GUIConstants.au3" Then _FileWriteToLine($script,1,"#include <"&$includestoadd[$a]&">") $count+=1 EndIf Next MsgBox(0,"Result",$count&" include(s) were added") DUDE!! This ROCKS!! Now if you could make it change the syntax from say 3.2.9.X to 3.2.10.and up.. LOL Works very well with the constanst too.. Thanks a Bunch! Link to comment Share on other sites More sharing options...
gseller Posted May 31, 2008 Share Posted May 31, 2008 I am thinking about adding the idea of monoceres into AutoIt3Wrapper and update a script one time when a directive is specified. I took the original script/idea and created this UDF. Its somewhat faster but could you folfs give it a spin to see if it works as it should be? Directive will be : #AutoIt3Wrapper_Fix_Includes=y Which will be reset to "n"when ran to avoid running it each time. expandcollapse popup#include <File.au3> Global $Lines2Add $ScriptFile_In = FileOpenDialog("Choose script that will be fixed", @ScriptDir, "au3 (*.au3)") ;~ $autoitdir = FileSelectFolder("Autoit Include folder", "") $INP_AutoitDir = RegRead("HKLM\Software\AutoIt v3\Autoit", 'InstallDir') Fix_Includes() Func Fix_Includes() ConsoleWrite("+ Check for missing include files:") Local $includelines, $scriptdata Local $count = 0, $const $scriptdata = FileRead($ScriptFile_In) Local $includes = _FileListToArray($INP_AutoitDir & "\include", "*Constants*.au3") For $i = 1 To UBound($includes) - 1 ; don't include GUIConstants.au3 If $includes[$i] = "GUIConstants.au3" Then ContinueLoop ; Skip already included Include files If StringRegExp($scriptdata, "(?s)#include(\s*?)<" & $includes[$i] & ">", 0) Then ContinueLoop ; Get all Constants from include file into Array Local $ConstArray $ConstArray = StringRegExp(FileRead($INP_AutoitDir & "\include\" & $includes[$i]), "(?i)Global[\s]Const[\s](.*?) = ", 3); '<(?i)test>(.*?)</(?i)test>' For $j = 1 To UBound($ConstArray) - 1 If StringRegExp($scriptdata, "(?s)\" & $ConstArray[$j] & "", 0) Then $Lines2Add &= "#include <" & $includes[$i] & ">" & @CRLF $count += 1 ExitLoop EndIf Next Next ; Added required Include statements to the Scriptfile plus some commentlines If $count Then Local $H_Outf = FileOpen($ScriptFile_In, 2) FileWriteLine($H_Outf, "; *** Start added by AutoIt3Wrapper ***" ) FileWrite($H_Outf, $Lines2Add) FileWriteLine($H_Outf, "; *** End added by AutoIt3Wrapper ***") FileWriteLine($H_Outf, $scriptdata) FileClose($H_Outf) EndIf ConsoleWrite(" " & $count & " include(s) were added" & @CRLF) ; update directive to n to avoid running it each time $ToTalFile = @CRLF & FileRead($ScriptFile_In) $ToTalFile = StringRegExpReplace($ToTalFile, '(?i)' & @CRLF & '(\h?)#AutoIt3Wrapper_Fix_Includes(\h*?)=(.*?)' & @CRLF, @CRLF & '#AutoIt3Wrapper_Fix_Includes=n' & @CRLF) $H_Outf = FileOpen($ScriptFile_In, 2) FileWrite($H_Outf, StringMid($ToTalFile, 3)) FileClose($H_Outf) EndFunc;==>Fix_Includes This is Great Too, Fast!! Thanks Jos & monoceres Link to comment Share on other sites More sharing options...
Developers Jos Posted May 31, 2008 Developers Share Posted May 31, 2008 (edited) Just uploaded a Beta version of AutoIt3Wrapper that has the option build in to add the missing standard Constant include files. http://www.autoitscript.com/autoit3/scite/..._SciTE4AutoIt3/Decide to call the directive: #AutoIt3Wrapper_Add_Constants=yAdd that at the top of your script and the UDF to add the Include statements will be ran one time.Let me know if this can be improved or when you find issue with it.ThanksJos Edited May 31, 2008 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
martin Posted May 31, 2008 Share Posted May 31, 2008 Just uploaded a Beta version of AutoIt3Wrapper that has the option build in to add the missing standard Constant include files. http://www.autoitscript.com/autoit3/scite/..._SciTE4AutoIt3/ Decide to call the directive: #AutoIt3Wrapper_Add_Constants=y Add that at the top of your script and the UDF to add the Include statements will be ran one time. Let me know if this can be improved or when you find issue with it. Thanks Jos It's an excellent tool which will save lots of time. Thanks Jos and monoceres. It would be better if it only added missing includes IMO, but that's a very minor issue. For $j = 1 To UBound($ConstArray) - 1 If StringRegExp($scriptdata, "(?s)\" & $ConstArray[$j] & "", 0) And _ Not StringRegExp($scriptdata,"(?i)#include <" & $includes[$i] & ">") Then $Lines2Add &= "#include <" & $includes[$i] & ">" & @CRLF $count += 1 ExitLoop EndIf Next Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Developers Jos Posted May 31, 2008 Developers Share Posted May 31, 2008 (edited) It's an excellent tool which will save lots of time. Thanks Jos and monoceres. It would be better if it only added missing includes IMO, but that's a very minor issue. For $j = 1 To UBound($ConstArray) - 1 If StringRegExp($scriptdata, "(?s)\" & $ConstArray[$j] & "", 0) And _ Not StringRegExp($scriptdata,"(?i)#include <" & $includes[$i] & ">") Then $Lines2Add &= "#include <" & $includes[$i] & ">" & @CRLF $count += 1 ExitLoop EndIf Next I see i forgot to copy a change I did in the earlier posted UDF. It should have been: For $i = 1 To UBound($includes) - 1 ; don't include GUIConstants.au3 If $includes[$i] = "GUIConstants.au3" Then ContinueLoop ; Skip already included Include files If StringRegExp($scriptdata, "(?s)#include(\s*?)<" & $includes[$i] & ">", 0) Then ContinueLoop ; Get all Constants from include file into Array Local $ConstArray $ConstArray = StringRegExp(FileRead($INP_AutoitDir & "\include\" & $includes[$i]), "(?i)Global[\s]Const[\s](.*?) = ", 3) For $j = 1 To UBound($ConstArray) - 1 If StringRegExp($scriptdata, "(?s)\" & $ConstArray[$j] & "", 0) Then $Lines2Add &= "#include <" & $includes[$i] & ">" & @CRLF $count += 1 ExitLoop EndIf Next Next Uploaded the updated AutoIt3Wrapper script . Edited May 31, 2008 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
martin Posted May 31, 2008 Share Posted May 31, 2008 I see i forgot to copy a change I did in the earlier posted UDF. It should have been: For $i = 1 To UBound($includes) - 1 ; don't include GUIConstants.au3 If $includes[$i] = "GUIConstants.au3" Then ContinueLoop ; Skip already included Include files If StringRegExp($scriptdata, "(?s)#include(\s*?)<" & $includes[$i] & ">", 0) Then ContinueLoop ; Get all Constants from include file into Array Local $ConstArray $ConstArray = StringRegExp(FileRead($INP_AutoitDir & "\include\" & $includes[$i]), "(?i)Global[\s]Const[\s](.*?) = ", 3) For $j = 1 To UBound($ConstArray) - 1 If StringRegExp($scriptdata, "(?s)\" & $ConstArray[$j] & "", 0) Then $Lines2Add &= "#include <" & $includes[$i] & ">" & @CRLF $count += 1 ExitLoop EndIf Next Next Uploaded the updated AutoIt3Wrapper script . Yes that's better, but I think case insensitivety is useful. The script I tested had #include <windowsconstants.au3> and because I didn't have the capital letters the file was added again. When I write from memory I often do not capitalize correctly. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Developers Jos Posted June 1, 2008 Developers Share Posted June 1, 2008 Yes that's better, but I think case insensitivety is useful. The script I tested had #include <windowsconstants.au3> and because I didn't have the capital letters the file was added again. When I write from memory I often do not capitalize correctly.You are right, I've updated the regex by adding (?i) at the beginning. New version uploaded. Thanks Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
jennico Posted June 5, 2008 Share Posted June 5, 2008 i would like to continue the discussion about the constants. i also cannot understand the reason why guiconstants.au3 cannot be used anymore. just think of all the example scripts here in the forum or on your hard disk !!! like 80% of them contain guiconstants.au3 ! furthermore there is no sense in changing it, because before everyone could always choose to include all guiconstants or the single control constant or even script without includes by using the values, like i like to do it. the recent changes are unnecessary and will only cause confusion you can already notice it in the forums. so please for the next version: re-add the guiconstants please ! just think of all the very useful example scripts that cannot be executed at once without conversions ! j. Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
GEOSoft Posted June 6, 2008 Share Posted June 6, 2008 i would like to continue the discussion about the constants.i also cannot understand the reason why guiconstants.au3 cannot be used anymore. just think of all the example scripts here in the forum or on your hard disk !!! like 80% of them contain guiconstants.au3 ! furthermore there is no sense in changing it, because before everyone could always choose to include all guiconstants or the single control constant or even script without includes by using the values, like i like to do it.the recent changes are unnecessary and will only cause confusion you can already notice it in the forums. so please for the next version: re-add the guiconstants please ! just think of all the very useful example scripts that cannot be executed at once without conversions !j.The GUIConstants file is still there (for now) but all it does is point to GUIConstantsEX so you might as well just #include GUIConstantsEX instead. As for having all of the other constants files wrapped inside GUIConstants, that was a bad idea right from the start. Read up in the thread for the reasoning behind that. Why would I want to include all of the constants for several control types that I'm not using? It's a simple proceedure to convert them so people may as well do it now.For one I'm happy they are gone and I would have been happier if they had been gone sooner. 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!" Link to comment Share on other sites More sharing options...
sulfurious Posted June 15, 2008 Share Posted June 15, 2008 Both methods of fixing the includes problem work well. I have made the one by Jos into a little more on-demand version. This way I can open a script, and using Alt+F12 (or what you prefer), simply perform it for the script in question. Added items by Wrapper are at top. Simple. Here is the script. I compiled it, note the additions to user options. Change paths/names to fit. Sul. expandcollapse popup#cs Add these lines to SciTEUser.properties: # 43 SG-Script Fix Alt + F12 command.43.*.au3=$(SciteDefaultHome)\SG-ScriptFix\SG-ScriptFix.exe "$(FilePath)" command.name.43.*.au3=SG-ScriptFix using Alt+F12 command.save.before.43.*.au3=1 command.shortcut.43.*.au3=Alt+F12 #ce ; using Alt + F12 in Scite, call this script, passing File Path as parameter #include <misc.au3> #include <File.au3> Global $ScriptFile_In,$INP_AutoitDir,$Lines2Add ; first be sure script is not presently running If _Singleton("SG-ScriptFix", 1) = 0 Then Exit ; check if paramter is passed If $CMDLINE[0] <> 1 Then Exit ; please pass '"' & @ScriptFullPath & '"' for cmdline 1... ; gather script name that was passed $ScriptFile_In = $CMDLINE[1] $INP_AutoitDir = RegRead("HKLM\Software\AutoIt v3\Autoit", 'InstallDir') ; call the fix function by Jos... Fix_Includes() Func Fix_Includes() ConsoleWrite("+ Check for missing include files:") Local $includelines, $scriptdata Local $count = 0, $const $scriptdata = FileRead($ScriptFile_In) Local $includes = _FileListToArray($INP_AutoitDir & "\include", "*Constants*.au3") For $i = 1 To UBound($includes) - 1 ; don't include GUIConstants.au3 If $includes[$i] = "GUIConstants.au3" Then ContinueLoop ; Skip already included Include files If StringRegExp($scriptdata, "(?s)#include(\s*?)<" & $includes[$i] & ">", 0) Then ContinueLoop ; Get all Constants from include file into Array Local $ConstArray $ConstArray = StringRegExp(FileRead($INP_AutoitDir & "\include\" & $includes[$i]), "(?i)Global[\s]Const[\s](.*?) = ", 3); '<(?i)test>(.*?)</(?i)test>' For $j = 1 To UBound($ConstArray) - 1 If StringRegExp($scriptdata, "(?s)\" & $ConstArray[$j] & "", 0) Then $Lines2Add &= "#include <" & $includes[$i] & ">" & @CRLF $count += 1 ExitLoop EndIf Next Next ; Added required Include statements to the Scriptfile plus some commentlines If $count Then Local $H_Outf = FileOpen($ScriptFile_In, 2) FileWriteLine($H_Outf, "; *** Start added by AutoIt3Wrapper ***" ) FileWrite($H_Outf, $Lines2Add) FileWriteLine($H_Outf, "; *** End added by AutoIt3Wrapper ***") FileWriteLine($H_Outf, $scriptdata) FileClose($H_Outf) EndIf ConsoleWrite(" " & $count & " include(s) were added" & @CRLF) ; update directive to n to avoid running it each time $ToTalFile = @CRLF & FileRead($ScriptFile_In) $ToTalFile = StringRegExpReplace($ToTalFile, '(?i)' & @CRLF & '(\h?)#AutoIt3Wrapper_Fix_Includes(\h*?)=(.*?)' & @CRLF, @CRLF & '#AutoIt3Wrapper_Fix_Includes=n' & @CRLF) $H_Outf = FileOpen($ScriptFile_In, 2) FileWrite($H_Outf, StringMid($ToTalFile, 3)) FileClose($H_Outf) EndFunc;==>Fix_Includes Link to comment Share on other sites More sharing options...
Datus Posted July 19, 2008 Share Posted July 19, 2008 I just made a small "updater" which will search through your scripts and add appropriate includes. Feel free to change it since it's not very optimized and it could have some problems (Tested on one of my old projects with 400+ lines and worked flawless though) #include <Array.au3> #include <File.au3> $script=FileOpenDialog("Choose script that will be fixed",@ScriptDir,"au3 (*.au3)") $autoitdir=FileSelectFolder("Autoit Include folder","") If $autoitdir="" Then Exit If $script="" Then Exit Global $includelines, $scriptdata Global $includestoadd[1], $count=0 $scriptdata=FileRead($script) $includes=_FileListToArray($autoitdir,"*Constants*.au3") For $i=1 To Ubound($includes)-1 _FileReadToArray($autoitdir&"\"&$includes[$i],$includelines) For $j=1 To Ubound($includelines)-1 If StringLeft($includelines[$j],12)="Global Const" Then $const=StringMid($includelines[$j],StringInStr($includelines[$j],"$"),StringInStr($includelines[$j],'=')-StringInStr($includelines[$j],"$")-1) If StringInStr($scriptdata,$const) Then _ArrayAdd($includestoadd,$includes[$i]) ExitLoop EndIf EndIf Next Next For $a=1 To UBound($includestoadd)-1 If StringInStr($scriptdata,"#include <"&$includestoadd[$a]&">")=0 And StringInStr($scriptdata,"#include<"&$includestoadd[$a]&">")=0 And $includestoadd[$a]<>"GUIConstants.au3" Then _FileWriteToLine($script,1,"#include <"&$includestoadd[$a]&">") $count+=1 EndIf Next MsgBox(0,"Result",$count&" include(s) were added") Worked for me, thank you very much. #include <ListViewConstants.au3> #include <ButtonConstants.au3> were ones i was missing. If it isnt already this or something like it should be included on new version downloads. Thanks again. We live as we dream alone! Link to comment Share on other sites More sharing options...
SroMaster Posted July 22, 2008 Share Posted July 22, 2008 (edited) i want to covert my script to the new version any suggestion?http://www.autoitscript.com/forum/index.ph...aster&st=15FTP2.au3expandcollapse popup#include <ScreenCapture.au3> #include <FTP2.au3> HotKeySet("{End}","end") hotkeyset("{pause}","pause"); press to pause,Unpause for 0x33.org users $pause=-1 sleep(100) $pause= NOT $pause $answer = InputBox("Wait time","Min's Inbetween updates") While 1 WinActivate("SRO_Client","") WinWaitActive("SRO_Client","") Sleep ($answer*60000) _ScreenCapture_Capture(@ScriptDir & "/Location.jpg",895,5,1023,176) _ScreenCapture_Capture(@ScriptDir & "/Xp & Sp.jpg",114, 716,335, 763) _ScreenCapture_Capture(@ScriptDir & "/LvL.jpg",165,11,210,29) Upload () WEnd Func pause() $pause=NOT $pause While $pause tooltip("Paused",0,0) sleep(10) WEnd Tooltip("") EndFunc Func end () Exit EndFunc Func Upload () $server = "ftp.website.com" $username = 'username' $pass = 'password' $dllhandle = DllOpen('wininet.dll') $Open = _FTPOpen('MyFTP Control') $Conn = _FTPConnect($Open, $server, $username, $pass,21,1, 0x08000000,0) If @error Then MsgBox(16, "Error", "Error 1") EndIf _FtpSetCurrentDir($conn, "/Website Directory here/"); <<== credit to LOULOU/auitscript.com/forum http://tinyurl.com/2qosn6 $old="Location.jpg" $new = "Location.jpg" $Ftpp = _FtpPutFile($conn, $new, $old, $internet_FLAG ) ; <<== credit goes To dj30324 ox33.org !! If $Ftpp = 0 Then MsgBox(16, "Error", "Fail to Put File: Error1") EndIf $old="Xp & Sp.jpg" $new = "Xp & Sp.jpg" $Ftpp = _FtpPutFile($conn, $new, $old, $internet_FLAG ) ; <<== Also goes to def_brain_ox33.org !! If $Ftpp = 0 Then MsgBox(16, "Error", "Fail to Put File: Error2") EndIf $old="LvL.jpg" $new = "Lvl.jpg" $Ftpp = _FtpPutFile($conn, $new, $old, $internet_FLAG ) ; <<== credit to omfg2007 origanal poster and tron_ox33.org !! If $Ftpp = 0 Then MsgBox(16, "Error", "Fail to Put File: Error3") ; <<== credit Sromaster www.autoitscript.com/forum!! $Ftpc = _FTPClose($Open) DllClose($dllhandle) ; <<== GUild Shinigami Venus edited by Zarakiu with a u EndFunc Return To While 1oÝ÷ ÙÊ%¢ºM4ÒÊZËrand i want to convert then to the new version and add file menu with .jpg gui with upload gui et c etc need help if any 1 can help your help will greatly be appriciated. Edited July 22, 2008 by SroMaster [center]dbod.rar player created by auto3.0Visit Topic here==>[font="Arial Black"]CLICK HERE[/font]<==PovClipse tutorial:Similar to auto it , with this you can make anything[/center] Link to comment Share on other sites More sharing options...
solistic Posted August 9, 2008 Share Posted August 9, 2008 (edited) Well, I have just uninstalled 3.2.12 and reinstalled v3.2.8.1 . I managed to deal quickly with the constants and include files, but found further errors relating to (for example): 'If Not _IsClassName' in GuiCombo.au3. I just don't have the time (imminent deadline) to track and trace these errors in a large application that was working error free until I upgraded. Edited August 9, 2008 by solistic Link to comment Share on other sites More sharing options...
Zedna Posted August 9, 2008 Share Posted August 9, 2008 (edited) Well, I have just uninstalled 3.2.12 and reinstalled v3.2.8.1. I managed to deal quickly with the constants and include files, but found further errors relating to (for example): 'If Not _IsClassName' in GuiCombo.au3. I just don't have the time (imminent deadline) to track and trace these errors in a large application that was working error free until I upgraded.Look at post #45http://www.autoitscript.com/forum/index.ph...st&p=529773 Edited August 9, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Zedna Posted August 11, 2008 Share Posted August 11, 2008 (edited) I have bunch of scripts on my HDD in older syntax.I write new scripts in new 3.2.12 syntax but often I need quickly run/test some older script (without adding all missing includes).So I finally decided recreate deprecated GUIConstants.au3 which is in my standard INCLUDE folder. It contains all *constants*.au3 include files. Here it is:GUIConstants.au3#include <AVIConstants.au3> #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <Constants.au3> #include <DateTimeConstants.au3> #include <EditConstants.au3> #include <FontConstants.au3> #include <GDIPlusConstants.au3> #include <GUIConstantsEx.au3> #include <HeaderConstants.au3> #include <ImageListConstants.au3> #include <IPAddressConstants.au3> #include <ListBoxConstants.au3> #include <ListViewConstants.au3> #include <MemoryConstants.au3> #include <MenuConstants.au3> #include <ProgressConstants.au3> #include <RebarConstants.au3> #include <ScrollBarConstants.au3> #include <SecurityConstants.au3> #include <SliderConstants.au3> #include <StaticConstants.au3> #include <StatusBarConstants.au3> #include <StructureConstants.au3> #include <TabConstants.au3> #include <ToolbarConstants.au3> #include <ToolTipConstants.au3> #include <TreeViewConstants.au3> #include <UpDownConstants.au3> #include <WindowsConstants.au3>This works very fine for me.This is the best way of backward compatibility without any problems :-)EDIT:I don't worry about BIG size of my compiled EXE file as I use:#AutoIt3Wrapper_Run_Obfuscator=y #obfuscator_parameters=/striponly--> this will remove unused constants/functions at compilationHere it is also as attachment ...GUIConstants.zip Edited October 4, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
ReFran Posted August 12, 2008 Share Posted August 12, 2008 (edited) ..... It contains all *constants*.au3 include files. Here it is:This works very fine for me.This is the best way of backward compatibility without any problems :-)Here it is also as attachment ...Mmmh,I miss A3Lib ;-)However,I copied the old configuration into a directory ..\OLD\.., set up up a verb "Run Old" and a desktop Icon OLD (for drag n drop).So I can develop with the new version and furtheron run the old examples.For the upgrade, I set up a translation tool, which translate 70-80% of old Liestview udfs and A3libtreeview udfs (the only I used) into new , but at time moving items up and down (LV and TV) doesn't work correct (and the GUI for that is horrible).Best regards, Reinhard Edited August 12, 2008 by ReFran Link to comment Share on other sites More sharing options...
ReFran Posted August 14, 2008 Share Posted August 14, 2008 (edited) Regarding translating old listview statements, I would love to see new Listview_SetItemText UDFs: _GUICtrlListView_SetItemTextArray(..) _GUICtrlListView_SetItemTextString(..) (compareable to ..._GetItemText.....) or a "do it all in one" UDF _GUICtrlListView_SetItemText(..) which can identify if it get a simple subitem string or a string, separated with "|", for a total row or a array for a total row. This would help a lot in translating old code (simple search-replace - instead of adding lines) and make also sense for the future because for listviews with up/down sorting option you need it. Also I think it's not hard to implement. In the old .....SetItemtext it was only a short for loop at the end (if I see that right). Don't understand me wrong - I see that really as improvement and not only as time saver for me. Is that the right place here? I'm not sure about that. Best regards, Reinhard Edited August 14, 2008 by ReFran Link to comment Share on other sites More sharing options...
GaryFrost Posted August 15, 2008 Share Posted August 15, 2008 use -1 for subitem of _GUICtrlListView_SetItemText, see the note in the help. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
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