iamtheky Posted August 1, 2015 Share Posted August 1, 2015 (edited) I asked this before, but it was buried in another thread with no response. So one more time, with feeling, any advantages or disadvantages to doing stuff this way? Other than the standard, "if they use X character it breaks". If you find that, then you probably know how to fix it and should just give up the regexp to replace my stringsplit In short, this uses a single MapAppend to write twice to the map. It writes the value to the next integer key in the map, and then writes the return value (that integer) and a string delimiter to the 'master key'. Getting the related values back out is just getting the master key (via dot notation) and parsing that delimited string for the locations.expandcollapse popup#include<array.au3> ;-----Filling The Map---- ;;;;;----------------populating on declare----- local $mMap[] $mMap['TestCat'] = MapAppend($mMap , 'Entry 1 about Cat') & "|" & MapAppend($mMap , 'Entry 2 about cat') & "|" & MapAppend($mMap , 'Entry 3 about cat') $mMap['TestDog'] = MapAppend($mMap , 'Entry 1 about Dog') $mMap['TestFish'] = MapAppend($mMap , 'Only entry about a Fish') ;;;;;-----populating the map with the _MapAddToKey function----- _MapAddToKey($mMap , "TestDog" , "Entry 2 about Dog") _MapAddToKey($mMap , "TestDog" , "Entry 3 about Dog") _MapAddToKey($mMap , "TestDog" , "An additional entry in the map tied to TestDog") _MapAddToKey($mMap , "TestCat" , "An additional entry in the map tied to TestCat") _MapAddToKey($mMap , "TestDog" , "One last entry tied to TestDog") ;----Getting things back---- ;------ _MasterKeyGetValues returns all values using dot notation for the master key msgbox(0, '' , _MasterKeyGetValues($mMap.TestDog)) msgbox(0, '' , _MasterKeyGetValues($mMap.TestCat)) msgbox(0, '' , _MasterKeyGetValues($mMap.TestFish)) ;------ _MapToArray dumps the map to an array with blank lines separating the groups. _ArrayDisplay(_MapToArray($mMap)) ;----Dumps the map to an Ini with Master key being the section and the values remaing values tied to numerical keys beginning with 0. _MapToIni($mMap , "TESToutput.ini") ;FUNCTIONS Func _MapAddToKey(ByRef $sMap , $sKey , $sValue) $sMap[$sKey] &= "|" & MapAppend($sMap , $sValue) EndFunc Func _MasterKeyGetValues($MasterKey) local $out = "" Local $aKeys = stringsplit($MasterKey , "|" , 2) For $j = 0 to ubound($aKeys) - 1 $out &= $mMap[number($aKeys[$j])] & @LF Next return stringstripWS($out , 2) EndFunc Func _MapToIni($Map , $outfile) Local $aMapKeys = MapKeys($Map) For $i = 0 to UBound($aMapKeys) - 1 If stringregexp($aMapKeys[$i] , "\D+") Then local $sValues = _MasterKeyGetValues($mMap[$aMapkeys[$i]]) IniWriteSection($outfile , $aMapKeys[$i] , "" & @LF) $aIniOut = stringsplit($sValues , @LF , 2) For $k = 0 to ubound($aIniOut) - 1 IniWrite($outfile , $aMapKeys[$i] , $k , $aIniOut[$k] & @LF) Next EndIf Next EndFunc Func _MapToArray($Map) Local $aOut[0] Local $aMapKeys = MapKeys($Map) For $i = 0 to UBound($aMapKeys) - 1 If stringregexp($aMapKeys[$i] , "\D+") Then local $sValues = _MasterKeyGetValues($mMap[$aMapkeys[$i]]) _ArrayAdd($aOut , $aMapKeys[$i]) $aItemsOut = stringsplit($sValues , @LF , 2) For $k = 0 to ubound($aItemsOut) - 1 _ArrayAdd($aOut , $aItemsOut[$k]) Next _ArrayAdd($aOut , "") EndIf Next return $aOut EndFunc Edited August 4, 2015 by boththose better example ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
iamtheky Posted August 3, 2015 Author Share Posted August 3, 2015 bump, with an added _MapToIni() Function.expandcollapse popuplocal $mMap[] $mMap['TestCat'] = MapAppend($mMap , 'Entry 1 about Cat') & "|" & MapAppend($mMap , 'Entry 2 about cat') & "|" & MapAppend($mMap , 'Entry 3 about cat') $mMap['TestDog'] = MapAppend($mMap , 'Entry 1 about Dog') $mMap['TestFish'] = MapAppend($mMap , 'Only entry about a Fish') _MapAddToKey($mMap , "TestDog" , "Entry 2 about Dog") _MapAddToKey($mMap , "TestDog" , "Entry 3 about Dog") _MapAddToKey($mMap , "TestDog" , "An additional entry in the map tied to TestDog") _MapAddToKey($mMap , "TestCat" , "An additional entry in the map tied to TestCat") _MapAddToKey($mMap , "TestDog" , "One last entry tied to TestDog") ;~ msgbox(0, '' , _MasterKeyGetValues($mMap.TestDog)) ;~ msgbox(0, '' , _MasterKeyGetValues($mMap.TestCat)) ;~ msgbox(0, '' , _MasterKeyGetValues($mMap.TestFish)) _MapToIni($mMap , "TESToutput.ini") Func _MapAddToKey(ByRef $sMap , $sKey , $sValue) $sMap[$sKey] &= "|" & MapAppend($sMap , $sValue) EndFunc Func _MasterKeyGetValues($MasterKey) local $out = "" Local $aKeys = stringsplit($MasterKey , "|" , 2) For $j = 0 to ubound($aKeys) - 1 $out &= $mMap[number($aKeys[$j])] & @LF Next return stringstripWS($out , 2) EndFunc Func _MapToIni($Map , $outfile) Local $aMapKeys = MapKeys($Map) For $i = 0 to UBound($aMapKeys) - 1 If stringregexp($aMapKeys[$i] , "\D+") Then local $sValues = _MasterKeyGetValues($mMap[$aMapkeys[$i]]) IniWriteSection($outfile , $aMapKeys[$i] , "" & @LF) $aIniOut = stringsplit($sValues , @LF , 2) For $k = 0 to ubound($aIniOut) - 1 IniWrite($outfile , $aMapKeys[$i] , $k , $aIniOut[$k] & @LF) Next EndIf Next EndFunc ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
guinness Posted August 3, 2015 Share Posted August 3, 2015 Your code is a little bit hard to decipher, but anyway I think I understand your point. Had to lookup in the help file what 2 was for the StringSplit() parameter. It's no misuse, though I would avoid using dot notation for now, in fact I wouldn't use the map data structure in production code, but instead opt for the stable Scripting.Dictionary. 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 Link to comment Share on other sites More sharing options...
jaberwacky Posted August 3, 2015 Share Posted August 3, 2015 (edited) Here is what might be a safer version if you're a fan of autoitobject.expandcollapse popup#AutoIt3Wrapper_Version=B #AutoIt3Wrapper_Run_AU3Check=n #AutoIt3Wrapper_AU3Check_Parameters=-w 1 -w 2 -w 3 -w 4 -w 6 -w 7 -d #include "AutoItObject.au3" #include <StringConstants.au3> _AutoItObject_StartUp() _main() _AutoItObject_ShutDown() Func _main() Local $mMap = _Map() $mMap.AddToMasterKey("TestCat", "Entry 1 about Cat") $mMap.AddToMasterKey("TestCat", "Entry 2 about cat") $mMap.AddToMasterKey("TestCat", "Entry 3 about cat") $mMap.AddToMasterKey("TestCat", "An additional entry in the map tied to TestCat") $mMap.AddToMasterKey("TestDog", "Entry 1 about Dog") $mMap.AddToMasterKey("TestDog", "Entry 2 about Dog") $mMap.AddToMasterKey("TestDog", "Entry 3 about Dog") $mMap.AddToMasterKey("TestDog", "An additional entry in the map tied to TestDog") $mMap.AddToMasterKey("TestDog", "One last entry tied to TestDog") $mMap.AddToMasterKey("TestFish", "Only entry about a Fish") ConsoleWrite($mMap.MasterKeyGetValues("TestCat") & @CRLF) ConsoleWrite($mMap.MasterKeyGetValues("TestDog") & @CRLF) ConsoleWrite($mMap.MasterKeyGetValues("TestFish") & @CRLF) ConsoleWrite($mMap.MasterKeyGetValues("TestIdiot") & @CRLF) $mMap.ToIni("TESToutput.ini") EndFunc Func _Map() With _AutoItObject_Class() #Region ; External .AddMethod("AddToMasterKey", "_Map_AddToMasterKey") .AddMethod("MasterKeyGetValues", "_Map_MasterKeyGetValues") .AddMethod("ToINI", "_Map_ToINI") #EndRegion #Region ; Internal .AddMethod("AddToMasterKeyList", "_Map_AddToMasterKeyList", True) Local $mMap[] .AddProperty("Map", $elscope_private, $mMap) Local $mMasterKey[] .AddProperty("MasterKey", $elscope_private, $mMasterKey) .AddProperty("MasterKeyCount", $elscope_private, 0) .AddProperty("Seperator", $elscope_private, '|') #EndRegion Local Const $this = .Object EndWith Return $this EndFunc Func _Map_AddToMasterKey($this, $sMasterKey, Const $sValue) $sMasterKey = StringStripWS($sMasterKey, $STR_STRIPTRAILING + $STR_STRIPLEADING) With $this .AddToMasterKeyList($sMasterKey) Local $mMap[] $mMap = .Map $mMap[$sMasterKey] &= MapAppend($mMap, $sValue) & .Seperator .Map = $mMap EndWith EndFunc Func _Map_AddToMasterKeyList($this, Const $sMasterKey) Local $mMap[] With $this $mMap = .MasterKey $mMap[$sMasterKey] = '' .MasterKey = $mMap .MasterKeyCount += 1 EndWith EndFunc Func _Map_MasterKeyGetValues(Const $this, $sMasterKey) $sMasterKey = StringStripWS($sMasterKey, $STR_STRIPTRAILING + $STR_STRIPLEADING) With $this If Not MapExists(.Map, $sMasterKey) Then Return SetError(1, 0, '') EndIf Local Const $key = StringTrimRight(.Map[$sMasterKey], 1) Local Const $aKeys = StringSplit($key, .Seperator, $STR_NOCOUNT) Local $out = '' For $sKey In $aKeys $out &= .Map[Number($sKey)] & .Seperator Next EndWith Return StringStripWS($out, $STR_STRIPTRAILING) EndFunc Func _Map_ToIni(Const $this, Const $outfile) With $this Local Const $aMasterKeys = MapKeys(.MasterKey) Local $aIniOut, $sValues For $sMasterKey In $aMasterKeys $sValues = StringTrimRight(.MasterKeyGetValues($sMasterKey), 1) $aIniOut = StringSplit($sValues, .Seperator, $STR_NOCOUNT) For $k = 0 To UBound($aIniOut) - 1 IniWrite($outfile, $sMasterKey, $k, $aIniOut[$k]) Next Next EndWith EndFuncEdit: Needs more error checking. Edited August 3, 2015 by jaberwacky now ever more somewhat safer code Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Administrators Jon Posted August 3, 2015 Administrators Share Posted August 3, 2015 Your code is a little bit hard to decipher, but anyway I think I understand your point. Had to lookup in the help file what 2 was for the StringSplit() parameter. It's no misuse, though I would avoid using dot notation for now, in fact I wouldn't use the map data structure in production code, but instead opt for the stable Scripting.Dictionary.I'm 80% sure I'm going to remove the dot notation. It causes some internal headaches for almost zero gain. Those headaches are one of the reasons it didn't end up in last release. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
guinness Posted August 3, 2015 Share Posted August 3, 2015 I would if that's the case. I know JavaScript has dot notation and array access for object literals, but last time I checked AutoIt ain't JS =) You're right though, the gain of having maps outweighs the need for dot access. 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 Link to comment Share on other sites More sharing options...
jchd Posted August 3, 2015 Share Posted August 3, 2015 I read this as well and guess that DllStruct dot notation isn't going to get dropped. Am I right? This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Administrators Jon Posted August 3, 2015 Administrators Share Posted August 3, 2015 I wish that wasn't there either (similar headaches and usage weirdness), but it would cause drama if dropped. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
iamtheky Posted August 3, 2015 Author Share Posted August 3, 2015 I do need to learn some scripting dictionary, and some autoitobject, along with the .ps1 -- so many lands of autoit yet unexplored. ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
UEZ Posted August 3, 2015 Share Posted August 3, 2015 (edited) I used maps to initialize a GDI+ script which imho is very useful to use maps.Maybe I've to rewrite it again when maps are removed...expandcollapse popupFunc _GDIPlus_RotatingText_Init($iWidth, $iHeight, $sText, $fFontSize = 190, $sFont = "Impact", $iColor_Txt = 0x404058, $iColor_TxtBorder = 0x101010, $iPen_Size = 4, $fSwing = 290, $iPerspCorrection = 2500) Local $aData[] $aData.iWidth = $iWidth $aData.iHeight = $iHeight $aData.fCenterX = $iWidth / 2 $aData.fCenterY = $iHeight / 2 $aData.fSwing = $fSwing $aData.iPerspCorrection = $iPerspCorrection $aData.fCenterY = $iHeight / 2 $aData.hGUI = GUICreate("GDI+ Rotating Text Loading Screen", $iWidth, $iHeight, -1, -1, $WS_POPUPWINDOW, $WS_EX_TOPMOST) $aData.hDC = _WinAPI_GetDC($aData.hGUI) $aData.hHBitmap = _WinAPI_CreateCompatibleBitmap($aData.hDC, $iWidth, $iHeight) $aData.hDC_backbuffer = _WinAPI_CreateCompatibleDC($aData.hDC) $aData.DC_obj = _WinAPI_SelectObject($aData.hDC_backbuffer, $aData.hHBitmap) $aData.hGraphic = _GDIPlus_GraphicsCreateFromHDC($aData.hDC_backbuffer) $aData.hBrush = _GDIPlus_BrushCreateSolid(0xFF000000 + $iColor_Txt) $aData.hBrushColor = $iColor_Txt $aData.hPen = _GDIPlus_PenCreate(0, $iPen_Size) $aData.hPenColor = $iColor_TxtBorder _GDIPlus_PenSetLineJoin($aData.hPen, 2) $aData.hFamily = _GDIPlus_FontFamilyCreate($sFont) $aData.hFormat = _GDIPlus_StringFormatCreate(0x1000) _GDIPlus_StringFormatSetAlign($aData.hFormat, 1) _GDIPlus_StringFormatSetLineAlign($aData.hFormat, 1) $aData.hFont = _GDIPlus_FontCreate($aData.hFamily, $fFontSize, 0) $aData.tLayout = _GDIPlus_RectFCreate(0, 0, $iWidth, $iHeight) $aData.hPath = _GDIPlus_PathCreate() _GDIPlus_PathAddString($aData.hPath, $sText, $aData.tLayout, $aData.hFamily, 0, $fFontSize, $aData.hFormat) Local $aDim = _GDIPlus_PathGetWorldBounds($aData.hPath) Local Const $hIter = _GDIPlus_PathIterCreate($aData.hPath) $aData.iAdd = 30 $aData.iAdd2 = $aData.iAdd / 2 Local $iPnt, $iCnt = 0, $aPath[0] While 1 $iCnt += 1 If $iCnt >= UBound($aPath) Then ReDim $aPath[$iCnt + 1] $aPath[$iCnt] = _GDIPlus_PathCreate() $iPnt = _GDIPlus_PathIterNextMarkerPath($hIter, $aPath[$iCnt]) If $iPnt <= 0 Then ExitLoop _GDIPlus_PathFlatten($aPath[$iCnt], 0.1) WEnd $aPath[0] = $iCnt $aData.aPath = $aPath _GDIPlus_PathIterDispose($hIter) $aData.iAmountCorners = 4 Local $fSize = $iHeight ;550 Global $__g_aCoordinates[$aData.iAmountCorners][3] = [ _; X Y Z [-$fSize, -$fSize, 0], _ ;2 [ $fSize, -$fSize, 0], _ ;3 [-$fSize, $fSize, 0], _ ;0 [ $fSize, $fSize, 0]] _ ;1 ; 0 1 ; ; ; 2 3 Local $binASM_Blur If @AutoItX64 Then $binASM_Blur = "0x575653554889CF4889D14C89C34C89CE0F314989C24889D848F7E148C1E0024889C266480F6EEA66480F6EF7660FEFFF66480F7EEA66480F7EF7660F1247FC4889CB48C1E302909090909090909090904889F84829D8660F124F04660F1210660F121C8F660F60C7660F60CF660F60D7660F60DF660FDDC1660FDDC2660FDDC3660F71D002660F67C7660F13074883C7084883EA080F89B5FFFFFF4883EE01758B0F770F314C29D05D5B5E5FC3" Else ;x32 $binASM_Blur = "0x8B7C24048B4C24088B5C240C8B7424100F315089D8F7E1C1E00289C2660F6EEA660F6EF7660FEFFF660F7EEA660F7EF7660F1247FC89CBC1E30290909090909089F829D8660F124F04660F1210660F121C8F660F60C7660F60CF660F60D7660F60DF660FDDC1660FDDC2660FDDC3660F71D002660F67C7660F130783C70883EA080F89B9FFFFFF83EE0175980F775B0F3129D8C3" EndIf Local $aCodeBuffer_ASM = _DLLStructCreate64("byte[" & StringLen($binASM_Blur) / 2 - 1 & "]");reserve Memory for opcodes DllStructSetData($aCodeBuffer_ASM[0], 1, $binASM_Blur) $aData.pCodeBuffer_ASM = DllStructGetPtr($aCodeBuffer_ASM[0]) $aData.pCodeBuffer_hMem = $aCodeBuffer_ASM[1] GUISetState(@SW_SHOW, $aData.hGUI) Return $aData EndFunc ;==>_GDIPlus_RotatingText_Init Edited August 3, 2015 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
trancexx Posted August 3, 2015 Share Posted August 3, 2015 I wish that wasn't there either (similar headaches and usage weirdness), but it would cause drama if dropped.I don't think it would if the drop would be justified. Why supporting something that doesn't work properly (if it really doesn't). My thinking is that no sane person would have anything against such healthy approach in development. You shouldn't be hiding behind (boring) "drama" argument, it makes you look fruity.However, could you explain a bit what's exactly weird about it? Also, are you sure the headaches are similar (or you said that just because)?May I ask that you answer the first question not as AutoIt developer, but rather as advanced AutoIt user - if possible. Thanks in advance Jon. Danyfirex 1 ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Administrators Jon Posted August 3, 2015 Administrators Share Posted August 3, 2015 I'll have to dig out the details from the thread in the MVP forum from last year - I can't remember all the bugs. It was something to do with long nested dot access. $something.somethingelse.something.something type things and confusion between methods/properties/function calls that caused me headaches. It would be a bit annoying to drop totally as I ended up going down your trail of having it as a pseudo COM object type. I created a new base class. Map and DllStruct then inherit this and provide methods and properties and then just get parsed exactly the same way. The COM parser only needs to know if it's a COM object or "A N Other" object. It was a decent amount of effort and In hindsight it's overkill for a bit of syntactic sugar it currently provides (assuming the concept isn't extended in future to make more use of the object-ness).I'd rather get the simple version in a stable release sooner in any case. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
trancexx Posted August 4, 2015 Share Posted August 4, 2015 But dot.dot.dot implies nested dllstructs. Are you saying that AutoIt can create dllstruct inside the dllstruct?The only visible "bug" with dot access on dllstruct is that array elements can be accessed only using literals, and this was left (back then when initially added) intentionally as safety for users not to attach to the feature too much until it'd be decided to fully support it. You missed the weird question. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
iamtheky Posted August 4, 2015 Author Share Posted August 4, 2015 Added a map to Array function that maintains the grouping as it would it appear dumped to an Ini. edited the op.So will everything but the dot notation still work going forward? Or are maps right out? ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) 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