Yashied Posted March 28, 2009 Share Posted March 28, 2009 Is it possible to implement in AutoIt array, each element of which represents a different array of arbitrary length? For example, Array[n] = [Array, Array[j], Array[k], ...] i<>j<>k Any ideas. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Authenticity Posted March 28, 2009 Share Posted March 28, 2009 Yes: Dim $a[3] = [1, 2, 3] Dim $b[3] = [4, 5, 6] Dim $c[3] = [7, 8, 9] Dim $avArray[3] = [$a, $b, $c]oÝ÷ ØzË"Êh²Èéb殶sdf÷"b33c¶ÒFò ¢Æö6Âb33c¶F×Òb33c¶d'&²b33c¶Ð ¢b4'&b33c¶F×FVà¢f÷"b33c¶¢ÒFòT&÷VæBb33c¶F×Ó¢6öç6öÆUw&FRb33c¶Fײb33c¶¥ÒfײD"¢æW@¢6öç6öÆUw&FRÄb¢VæD`¤æW Link to comment Share on other sites More sharing options...
TerarinK Posted March 28, 2009 Share Posted March 28, 2009 Dim $a[3] = [1, 2, 3] Dim $b[3] = [4, 5, 6] Dim $c[3] = [7, 8, 9] Dim $avArray[3] = [$a, $b, $c] For $i = 0 To UBound($avArray) - 1 Local $aTmp = $avArray[$i] If IsArray($aTmp) Then For $j = 0 To UBound($aTmp) - 1 ConsoleWrite($aTmp[$j] & @TAB) Next ConsoleWrite(@LF) EndIf Next Only one correction I made to his script otherwise give him all the credit for it For $i = 0 To UBound($avArray) - 1 0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E Link to comment Share on other sites More sharing options...
Yashied Posted March 28, 2009 Author Share Posted March 28, 2009 Thanks. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted March 28, 2009 Share Posted March 28, 2009 Thanks, but how to get in your sample, for example, only the number 3? CODEConsoleWrite($aTmp[0][2]) - does not work.What you are doing there is trying to get a value from a 2d array. To get a value from the "array in the array" you must do as Authenticity showed. By the way what are you really trying to do? Storing arrays in arrays are very rarely used and there is often another "better" solution. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Yashied Posted March 28, 2009 Author Share Posted March 28, 2009 (edited) What you are doing there is trying to get a value from a 2d array. To get a value from the "array in the array" you must do as Authenticity showed. By the way what are you really trying to do? Storing arrays in arrays are very rarely used and there is often another "better" solution.I hurried to the reply, I have decided this. Thank you. Another thing that comes to mind is an array of pointers. $Array[n] = [$hWnd1, $hWnd2, ...] Edited March 28, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted March 28, 2009 Share Posted March 28, 2009 I hurried to the reply, I have decided this. Thank you. Another thing that comes to mind is an array of pointers. $Array[n] = [$hWnd1, $hWnd2, ...]Do you know you are good at confusing people? That look like a normal 1d array to me. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Yashied Posted March 28, 2009 Author Share Posted March 28, 2009 (edited) Do you know you are good at confusing people? That look like a normal 1d array to me.I do not who did not enter into confusion. I'm trying to get an array, each element of which must contain a package of data (strings, pointers, integer data, etc.). The pointer is just a way to get to the package. I do not want to create a multi-dimensional arrays for this purpose.Remark.I just want to know which option is preferable: a multidimensional array, or dynamic memory. Edited March 28, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 30, 2009 Share Posted March 30, 2009 I do not who did not enter into confusion. I'm trying to get an array, each element of which must contain a package of data (strings, pointers, integer data, etc.). The pointer is just a way to get to the package. I do not want to create a multi-dimensional arrays for this purpose. Remark. I just want to know which option is preferable: a multidimensional array, or dynamic memory. Within AutoIt, a 2D array is clearly preferable. Just define the array in your comments for reference. Example: ; 2D array containing 12 "packages": ; [0][0] = 1st string name ; [0][1] = 1st window handle ; [0][2] = 1st integer result ; [0][3] = 1st pointer to $tagPOINT struct ; ... ; [11][0] thru [11][3] = last "package" Global $avArray[12][4] The third window handle would be: $avArray[2][1] Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Yashied Posted March 30, 2009 Author Share Posted March 30, 2009 Within AutoIt, a 2D array is clearly preferable. Just define the array in your comments for reference. Example: ; 2D array containing 12 "packages": ; [0][0] = 1st string name ; [0][1] = 1st window handle ; [0][2] = 1st integer result ; [0][3] = 1st pointer to $tagPOINT struct ; ... ; [11][0] thru [11][3] = last "package" Global $avArray[12][4] The third window handle would be: $avArray[2][1] Thanks. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... 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