# Help File/Documentation Issues. (Discussion Only)

## Recommended Posts

_ArrayUnique only searches through one of the arrays dimensions, that parameter lets you select which of the 2 (if a 2D array) you're going to work with.

I see your angle; but this is a misunderstanding, or corruption, of the term 'dimensions' and also doesn't appear to be what the function does (I'm going to check it again). In two dimensions you need two indices for every single array element: That is a minimum requirement in both mathematics and programming. 1st dimension is a theoretical term of no practical significance in this implementation.

The term subitem, although vague in itself, would be consistant with other similar functions  The term dimension is used in the wrong context - totally. Unless you want to have undefined number of dimensions contained within two dimensions (which is nonsense), and stick to that terminology, I don't see how you can avoid confusing a lot of beginners; especially anyone with a mathematical background.

Edit

I've now double checked, although I know I'm right. Code below searches the 4th dimension according to the description. It returns a result from an array of only two dimensions. Semantically this is an impossible result.

;

```#include <Array.au3>

Local \$aDimensions[4][4] ; Two dimensional array

For \$i = 0 To 3
For \$j = 0 To 3
Next
Next

\$v4thDimension = _ArrayUnique(\$aDimensions, 4) ; Search the 4th dimension ^^

_ArrayDisplay(\$v4thDimension)```

;

\$iDimensions is a misnomer and the description is also incorrect because it does something other than what it says.

Edited by czardas

• Replies 705
• Created

#### Posted Images

You're right, it should say the subitem to search in a 2D array.

EDIT: In looking into the guts of that function, there's a lot more wrong with it than the documentation.

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

##### Share on other sites

BrewManNH Thanks for talking the time to look at it.

##### Share on other sites

Did you realize that if you send it a 1D array, and use any number greater than 1 in the \$iDimension parameter it will cause an error? There's no bounds checking done on the \$iDimension parameter.

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

##### Share on other sites

In looking into the guts of that function, there's a lot more wrong with it than the documentation.

Definitely a candidate for some refactoring.

`If Not \$iDimension > 0 Then`
##### Share on other sites

I'm working out a total rewrite of this function right now, it's painfully slow with large arrays. I fed it an array with 6 columns and 4104 rows, it took 106 seconds to return the array. It's an array filled with a list of MP3 files, with track #s, titles, album titles, artist, year of release and the path and file name of the file. Just going through the track numbers took no time at all, because there's lots of duplicates it didn't take long to cull the dupes. The file names are all unique, and that's the column that took forever.

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

##### Share on other sites

I wonder if it would be beneficial to sort the column and then use binary search?  Or is that what you're doing?  Realized as I try to sleep, binary search wouldn't even be necessary.

Edited by jaberwocky6669
##### Share on other sites

I have no time to look at this properly, but I would be cautious about using element declaration as a technique (sometimes seen on the forum). After my own >experiments in this area, I noticed that very large arrays containing mostly unique entries require so many variable names to be created that memory becomes a problem. Performance seems to seriously plummet over a certain number of declarations. This can not be predicted in advance due to the varied input.

Edit

Edited by czardas
##### Share on other sites

I'm guessing those MVPs who have svn access and commented here have fixed the issue(s)? I don't feel like going back through 4 pages of discussions.

##### Share on other sites

I think a better description of FileWrite might be in order/

Append a text/data to the end of a previously opened file.

"Writes text/data to a file in different ways (see remarks)"

Is my suggestion.

Monkey's are, like, natures humans.

##### Share on other sites

I think a better description of FileWrite might be in order/

"Writes text/data to a file in different ways (see remarks)"

Is my suggestion.

I can't guarantee I will always see these, so best to submit to Trac as stated in the first post. I have changed to this "Write text/data to the end of a previously opened file." because adding (see remarks) will display in the calltips of SciTE.
##### Share on other sites

Well there you have it, better in a discussion thread where people might provide feedback first, than a trac ticket bloater.

Monkey's are, like, natures humans.

##### Share on other sites

FileOpen

\$FO_APPEND (1) = Write mode (append to end of file)
\$FO_OVERWRITE (2) = Write mode (erase previous contents)

-------------------------------

\$FO_APPEND (1) = Write mode (append to end of file)
\$FO_OVERWRITE (2) = Write mode (append to end of file, erase previous contents)

##### Share on other sites

• Moderators

AZJIO,

As a native speaker of the Queen's English: the current text is perfectly logical - your suggested replacement is not. The word "append" implies an existing entity which remains unchanged and to which any new additions will be concatenated. This is completely incompatible with the actual "overwrite" and "erase previous contents" descriptions of the flag - which describe perfectly the actions taken to delete the existing entity and replace 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 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

##### Share on other sites

(see remarks) will display in the calltips of SciTE.

"Writes text/data to a file in different ways depending on arguments passed"

Might be in with a shout.

Monkey's are, like, natures humans.

##### Share on other sites

It should be in-line with how other File***() functions are written. It's only a description and thus should remain just as that.

##### Share on other sites

Fair enough, just thought is was not accurate.

Monkey's are, like, natures humans.

## Create an account

Register a new account

• ### Similar Content

• #### Simple Library Docs Generator

By water,

• 3,605 views
• #### SciTE4AutoIt3 Helpfile question

• 7 replies
• 1,283 views
• #### Help file for the AD UDF - similar to the AutoIt help file

By water,

• 14 replies
• 2,160 views
• #### [solved] Trac thinks my submission might be Spam.

By Skysnake,

• 2 replies
• 3,904 views
• #### HotKeySet in Help File is Broke?

By l3ill,

• 9 replies
• 7,033 views
×

• Wiki

• Back

• #### Beta

• Git
• FAQ
×
• Create New...