Associative Array

PeopleSoft Associative Arrays
Download MYLIB Associative Array Application Package

Wikipedia lists an Associate Array as: In computer science, an associative array, map, or dictionary is an abstract data type composed of a collection of (key,value) pairs, such that each possible key appears at most once in the collection.

PeopleSoft does not come with this type of data type so I have created an Application Package to allow for the creation of key/value pair storage. By downloading and importing the following project you will be able to reference the associative array class and create collections of key/value pairs.

Examples:

import MYLIB_ASSOC_ARRAY:*

&pairs = create MYLIB_ASSOC_ARRAY:ASSOC_ARRAY();

&pairs.set( "key", "value" );

&keyValue = &pairs.get( "key" )

&keyExists = &pairs.exists( "key" );

&pairs.unset( "key" );

&keys = &pairs.getKeys();

&pairLen = &pairs.len();

&keysFor = &pairs.keysForValue( "value" );

&mergePairs = create MYLIB_ASSOC_ARRAY:ASSOC_ARRAY();

&mergePairs.set( "key2", "value2" );

&mergePairs.merge( &pairs, true );
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License