Jump to content

Recommended Posts

Posted (edited)

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

  • 3 weeks later...
Posted

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

  Quote

+ 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

Posted

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)

  Reveal hidden contents

: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.

  Reveal hidden contents

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

  • 1 month later...
Posted

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

Expand  

 

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

Posted

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:

  Reveal hidden contents

Updated: 22/04/2018

  • 7 months later...
Posted

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

  • 3 years later...
Posted (edited)

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

Expand  

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

Posted
  On 5/16/2020 at 2:53 PM, TheDcoder said:

It is strange how I never created a topic about it

Expand  

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

Posted

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:

  Reveal hidden contents

 

Posted

@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

Posted

Beware that Maps don't allow negative integer keys.

  Reveal hidden contents

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)

Posted

@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

Posted (edited)

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

  Reveal hidden contents

Posted

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:

  Reveal hidden contents

 

Posted
  On 5/17/2020 at 3:23 PM, iamtheky said:

key = 0-1   :)

Expand  

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

  On 5/17/2020 at 4:05 PM, water said:

Seems we have at least two Map UDFs

Expand  

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.

  On 5/17/2020 at 4:05 PM, water said:

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

Expand  

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

Posted
  On 5/17/2020 at 2:44 PM, TheDcoder said:

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

Expand  

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

 

  Reveal hidden contents

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)

  • Moderators
Posted

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:

  Reveal hidden contents

 

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
×
×
  • Create New...