Jump to content

Recommended Posts

Posted

Hi guys!

I took @GaryFrost's Scripting Dictionary UDF and made just a few modifications.

It now accepts multiple Scripting Dictionary objects around your script (many at once) and also allows you to choose any name for your variable. Also, it now uses OOP-like approach as proposed by @guinness.

The modifications were too simple (and I would post it on the original thread, but it's dated 2007) so all credit goes to @GaryFrost.

Example:

#include 'scriptingdic.au3'
#include <Array.au3> ; Needed only for _ArrayDisplay, and not required by the lib

; Init the object
$oObj = _InitDictionary()

; Adding a single value
_AddItem($oObj, 0, "Test")
; And showing it
msgbox(0, '', _Item($oObj, 0))

; Adding an array
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]
_AddItem($oObj, 1, $aArr)
; And showing it
_ArrayDisplay(_Item($oObj, 1))

; We can also use this approach:
$oObj3 = _InitDictionary()
$oObj.Add("test", "foo")
MsgBox(0, '', $oObj.Item("test"))

Download: scriptingdic.au3

My stuff

  Reveal hidden contents

 

Posted
  On 5/5/2016 at 6:16 PM, Jefrey said:

; We can also use this approach: $oObj3 = _InitDictionary() $oObj.Add("test", "foo") MsgBox(0, '', $oObj.Item("test"))

Expand  
; We can also use this approach:
    $oObj3 = _InitDictionary()
    $oObj3.Add("test", "foo")
    MsgBox(0, '', $oObj3.Item("test"))

Nice, thanks for sharing.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

  • 1 year later...
Posted

Thanks
How can I search through the array: if string exists in form/same in "StringInStr" style ?

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