Jump to content

Array.au3 - Final Beta - Testing required


Melba23
 Share

Recommended Posts

  • Moderators

FrankwazHere,

From what I understand of that:

- Does _ArrayConcatenate do what you want? :huh:

- There is no overwriting - to do that use ArrayDelete followed by _ArrayInsert. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

FrankwazHere,

From what I understand of that:

- Does _ArrayConcatenate do what you want? :huh:

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

;Frank. 

Link to comment
Share on other sites

  • Moderators

FrankwazHere,

I want to do math (sum) on the values in my array

Then you will need to code a loop to do it. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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? :huh:

M23

Haven't had the opportunity to test it yet.

Edited 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 Gude
How 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

Link to comment
Share on other sites

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 by czardas
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by czardas
Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

Hi,

Added the limiting code - here are the 2 functions with a some examples showing it working: :)

<snip>

M23

Edited by Melba23
Code removed

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Moderators

AdamUL,

Feature requests as simple as that I am very happy to receive! Done. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

Hi,

Thanks to those who took the trouble to download and respond - much appreciated. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...