Moderators Melba23 Posted January 26, 2014 Author Moderators Posted January 26, 2014 FrankwazHere,From what I understand of that:- Does _ArrayConcatenate do what you want? - There is no overwriting - to do that use ArrayDelete followed by _ArrayInsert. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
FrankwazHere Posted January 26, 2014 Posted January 26, 2014 (edited) FrankwazHere, From what I understand of that: - Does _ArrayConcatenate do what you want? - There is no overwriting - to do that use ArrayDelete followed by _ArrayInsert. M23 Oops sorry I should have explained... _ArrayConcatenate will join two arrays, I want to do math (sum) on the values in my array. and YEs, _ArrayDelete and _ArrayInsert will work fine (I was getting greedy lol) thanks for your help! Edited January 26, 2014 by FrankwazHere ;Frank.
Moderators Melba23 Posted January 26, 2014 Author Moderators Posted January 26, 2014 FrankwazHere,I want to do math (sum) on the values in my arrayThen you will need to code a loop to do it. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
FrankwazHere Posted January 26, 2014 Posted January 26, 2014 Lol I saw your post in my future.. I tried. Thank you anyway. ;Frank.
BrewManNH Posted January 26, 2014 Posted January 26, 2014 (edited) BrewManNH, Because it offers the possibility of adding items directly to a specified columns of the array with the other columns being left empty - which I do not see as "poor programming". I found the need to do this for one of mt scripts and wrote a bespoke function - the same functionality based on that code is now in this _ArrayAdd function. - The poor programming comment was in regard to trying to add together 2 arrays of differing dimensions/size of dimensions. It appears, from your comment, that if the 2 arrays aren't identical in dimensions then you'll truncate the array being added, and I thought of that as a hack workaround to the user's poor programming in not making sure that the 2 match efore trying to add one to the other. But, I think adding that functionality, if it's going to be added, should be added to _ArrayConcatenate, and not to _ArrayAdd. Either that or get rid of _ArrayConcatenate as you've just superseded it by adding it's purpose to this function. As I already explained, the 2 functionalities are not identical, therefore that is not the case. Functionalities may not be the same, but the purpose of one has been supplanted by the other in a different manner. So, you've made one of them redundant. And do you have any comments on the suggested datatype solution? M23 Haven't had the opportunity to test it yet. Edited January 26, 2014 by BrewManNH If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
czardas Posted January 26, 2014 Posted January 26, 2014 (edited) The poor programming comment was in regard to trying to add together 2 arrays of differing dimensions/size of dimensions. It appears, from your comment, that if the 2 arrays aren't identical in dimensions then you'll truncate the array being added, and I thought of that as a hack workaround to the user's poor programming in not making sure that the 2 match efore trying to add one to the other. I agree with the principle, but not with your conclusion. You may wish to join arrays of unknown dimension size for reasons other than just out of laziness. I'm in favour of expanding dimension size to accomodate out of range elements when needed in specific cases. This should not necessarily be a core feature of a UDF function, nor am I suggesting that it should be. It's an easy task to write such a function yourself on such rare occasions that you might need to do something like that. I gave one example of this already where a csv - having no official standard format - written by somebody else may be inconsistant. As far as M23's new features are concerned, I have not given them a fair testing, so I will decline to comment further for the time being. Edited January 26, 2014 by czardas operator64 ArrayWorkshop
BrewManNH Posted January 26, 2014 Posted January 26, 2014 I agree with the principle, but not with your conclusion. You may wish to join arrays of unknown dimension size for reasons other than just out of laziness. I'm in favour of expanding dimension size to accomodate out of range elements when needed in specific cases. This should not necessarily be a core feature of a UDF function, nor am I suggesting that it should be. It's an easy task to write such a function yourself on such rare occasions that you might need to do something like that. I'd agree with you if the function didn't cut off the columns that didn't match from my understanding of it. If you expanded the array that was being added to, to match the array being added, that would make sense. But to cut off the parts that don't fit doesn't seem right. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
czardas Posted January 26, 2014 Posted January 26, 2014 (edited) I'd agree with you if the function didn't cut off the columns that didn't match from my understanding of it. If you expanded the array that was being added to, to match the array being added, that would make sense. But to cut off the parts that don't fit doesn't seem right. Perhaps that point does require some further scrutiny. In any case I think it's easy to criticize and forget the effort that went into something like this. Just saying, that's all. I do appreciate all these efforts, and do not expect one-solution-fits-all Swiss Army Knife functionality in Array.au3. I know I ask too much sometimes. Edited January 27, 2014 by czardas operator64 ArrayWorkshop
Moderators Melba23 Posted January 27, 2014 Author Moderators Posted January 27, 2014 BrewManNH,I do not believe that the number of columns in the initial array should be changed - regardless of the data to be added - as that would be doing things behind the coder's back which I do not see as either logical or desirable. However, I can see your point that truncating the data to fit is perhaps not sensible either. So what I propose is that the function fails if there are too many columns of data to fit into the original array, after taking the $iStart parameter into account. So you could still add a single column of data to the second column of an existing array (which was the functionality I needed when I wrote my bespoke function) but not if the data was part of a 2 column array itself. I will work on that today and I hope that the result will be satisfactory to you. Now to keeping both _ArrayAdd & _ArrayConcatenate. _ArrayConcatenate is a relatively simple function which merely joins arrays with the same values of dimension and column while allowing rows to be omitted from the source array (very useful given the number of arrays which have counts in the [0] element). Altering this function to become a wrapper for _ArrayAdd would actually add complexity as the current checks on compatibility would need to be remain while additional code would be needed to remove the unwanted rows from the source. The alternative of adding this row removal code to _ArrayAdd would needlessly increase the size and complexity of that function which quite rightly expects all the rows of the data passed to be added - and which was the very point you were making in respect of the columns. So I see every reason to keep both and I am no longer prepared to discuss this point as I would rather spend time coding than posting - take it up with the Devs if you so wish. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Moderators Melba23 Posted January 27, 2014 Author Moderators Posted January 27, 2014 (edited) Hi,Added the limiting code - here are the 2 functions with a some examples showing it working: <snip>M23 Edited January 28, 2014 by Melba23 Code removed Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
AdamUL Posted January 27, 2014 Posted January 27, 2014 Melba23, The _ArraySearch works good for me. I like how the search row option is specified in this function as well. If you don't mind me asking, could the search row option be added to _ArrayFindAll. It is already using the _ArraySearch function, so it looks like it wouldn't be too difficult to add this feature. Thanks, Adam
Moderators Melba23 Posted January 28, 2014 Author Moderators Posted January 28, 2014 AdamUL,Feature requests as simple as that I am very happy to receive! Done. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Moderators Melba23 Posted January 28, 2014 Author Moderators Posted January 28, 2014 Hi,Thanks to those who took the trouble to download and respond - much appreciated. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Recommended Posts