Jump to content

Experimental Maps UDF


TheDcoder
 Share

Recommended Posts

Hello Everyone! :D

I made a UDF for the new Maps Datatype, I tried to follow Best Coding Practices & UDF-Specs while making this. Please note that this UDF is in very early stages. A thanks to @boththose for ideas on functions (like _Maps_IniToMap).

If you have any suggestions, improvements, complaints, feature requests etc. Please don't hold back anything which can help improve this UDF! I will continue to develop this UDF as long as the Official AutoIt Dev Team adapts it (or makes another version of this UDF) :).

Enjoy! TD :D

Edited by TheDcoder
Added Download Link

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

  • 3 weeks later...

Uploaded v0.2! :D, Here is the change log:

+ Added _Map_MapToString function.
+ Added _Map_StringToMap function.
+ Added Example for _Map_Display function. (Yes, I forgot :P)
* Improved _Map_MapDisplay
* Improved _Map_ReassignKey
* Changed _Map_IniToMap, now it accepts $mIniFile (use it as a template for your IniFile)
* Fixed function order, _Map_Append was above _Map_1DArrayToMap.
* Fixed "Example: No" for all functions
* Commented on every line of code, it was harder than I thought it would be :P
* Tidied script
- Removed _Map_Remove (lol :lol:)

Phew :sweating:, Enjoy! TD :D

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

About time you did some work around here.

I don't think Google will be happy though.

:muttley:

P.S. Even if you Remove a Map, people will still want to go there .... probably more so, being dark and secret. B)

:P Just playing will all your minds ... all 14 of them. :alien:

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

  • 1 month later...

Uploaded all previous versions + v0.3 :D, Here is the change log:

Quote

+ Added _Map_Concatenate function.
+ Added _Map_Search function.
+ Added _Map_Unique function.
+ Uploaded All version (make sure that you choose the latest ;))
* Modified _Map_Append's description
* Tidied script
- Removed _Map_Remove from the current funtions list (lol again :P)

Some little improvements

 

Enjoy! TD :thumbsup:

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

I looked at your code and am not keen on Int($bCaseSensitive), as it assuming (although true) that false === 0 and true === 1. Not to mention, you should be using constants for setting case-sensitivity, you know, just in case 1 becomes 0 and vice versa.

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

  • 7 months later...

Long time no see ;). Released a new version, Release information on GitHub: https://github.com/TheDcoder/Experimental-Maps-UDF/releases/tag/v0.4.0 (Download also available here.)

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

  • 3 years later...

Hello everyone,

To celebrate the recent new releases of AutoIt Beta with critical bug fixes for maps, I have decided to create a topic for the Experimental Maps UDF that I created a few years ago. It is strange how I never created a topic about it :D

Here is the GitHub repository: https://github.com/TheDcoder/Experimental-Maps-UDF

Quote

Experimental Maps UDF

UDF for the Map datatype in AutoIt.

This UDF is made for Maps (similar to Array UDF), Map is a new datatype in AutoIt. This UDF is still in early development and might contain bugs (either in this UDF or the Map datatype itself)

THIS UDF IS NOT DEVELOPED OR MAINTAINED BY THE OFFICIAL AUTOIT TEAM

I made this UDF with the intention of speeding up the process of releasing the Map datatype in the stable releases of AutoIt. For this reason, this UDF is licensed under The Unlicense so that AutoIt Team can adapt this UDF freely. Unlicence gives the user of this UDF the right to copy, distribute, modify, compile etc... Please refer to LICENSE

I think it has all the basic functions, here is the list of all the functions currently in the repository:

; #CURRENT# =====================================================================================================================
; _Map_1DArrayToMap
; _Map_2DArrayToMap
; _Map_Append
; _Map_Concatenate
; _Map_ConvertToArray
; _Map_Delete
; _Map_DictObjectToMap
; _Map_Display
; _Map_IniToMap
; _Map_MapToDictObject
; _Map_MapToIni
; _Map_MapToString
; _Map_ReassignKey
; _Map_Search
; _Map_StringToMap
; _Map_Sync
; _Map_Unique
; ===============================================================================================================================

Have fun!

Edited by TheDcoder

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

9 minutes ago, TheDcoder said:

It is strange how I never created a topic about it

Turns out I did create a topic:

I just found that out when looking at the header comments in my UDF, very weird, I searched for this topic but I did not find anything, so I assumed I did not create a topic. @Mods is it possible to merge this thread into the other one, with the new posts appended?

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

Should this be merged with Melba23's Map UDF? So we have a single UDF holding everything we need? What do you think?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

@water Looks like M23 has removed his code, but yes, it is a good idea to merge it with another good UDF to make a master UDF which is good enough to be included in the standard library. My code is licensed under public domain, anyone can copy and use it freely.

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

Beware that Maps don't allow negative integer keys.

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 here
RegExp tutorial: enough to get started
PCRE 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

@jchd I see, that is interesting, is there a reason behind it? Is it a technical limitation of the hash table implementation?

P.S Strange how I didn't get a notification for this topic, and was not "following" it, I guess the followers got reset when this thread was merged with my duplicate.

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

key = 0-1   :)

And the map UDFs that move beyond the handful of core functions could definitely stand a revisit (at least once every 4 years).  I think my https://www.autoitscript.com/forum/topic/174758-scriptingdictionary-in-the-role-of-map/ may suffer from bloat more than the others, but things like the _Map_Append function wrap a one liner that takes less characters to write than the function call.  But going down those trails allow you to pull off tricks that I would like to see incorporated more, like this mapappend fun:

 

Edited by iamtheky
link and typo

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

Seems we have at least two Map UDFs and a hand full of examples to play with.

Shouldn't we try to combine this to a single Map UDF which then might get part of the AutoIt distro?
 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

1 hour ago, iamtheky said:

key = 0-1   :)

I am not sure I understand, can you elaborate? :)

1 hour ago, water said:

Seems we have at least two Map UDFs

The only other Map UDF that I am aware of is @iamtheky's wrapper around Scripting.Dictionary, so it is incompatible with my UDF which uses native AutoIt maps.

1 hour ago, water said:

Shouldn't we try to combine this to a single Map UDF which then might get part of the AutoIt distro?

Sure, anyone (including the AutoIt Team) can take my code and make their own UDF.

I am unfortunately unable to actively contribute to this effort as I am busy with some other projects and I am not regularly using AutoIt anymore as it is not available for Linux... I do intend to start working on my cross-platform port soon, just need to decide on a good name before I get started :)

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

3 hours ago, TheDcoder said:

is there a reason behind it? Is it a technical limitation of the hash table implementation?

For that you need to ask OverLord.  I just hit that block while testing the beta Map datatype and reported it:

https://www.autoitscript.com/forum/topic/202625-autoit-beta-33151-33152/?do=findComment&comment=1455266

 

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 here
RegExp tutorial: enough to get started
PCRE 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

  • Moderators

And it is now fixed in Beta 3.3.15.3:

2 OK
1 OK
0 OK
"M:\Program\Au3 Scripts\jchd_Map_Neg_Int_Test.au3" (3) : ==> Variable subscript badly formatted.:
$m[$i] = "aaa"
$m[^ ERROR

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...