https://github.com/r0mb0/dictionary_classic_asp
Library to create and manage dictionaries in Classic ASP
https://github.com/r0mb0/dictionary_classic_asp
asp-classic classic-asp classic-asp-lang classic-asp-language dictionary dynamic-array italian-developers library r0mb0
Last synced: 3 months ago
JSON representation
Library to create and manage dictionaries in Classic ASP
- Host: GitHub
- URL: https://github.com/r0mb0/dictionary_classic_asp
- Owner: R0mb0
- License: mit
- Created: 2024-10-29T11:49:16.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-12-17T14:51:06.000Z (6 months ago)
- Last Synced: 2025-03-10T06:16:46.036Z (4 months ago)
- Topics: asp-classic, classic-asp, classic-asp-lang, classic-asp-language, dictionary, dynamic-array, italian-developers, library, r0mb0
- Language: Classic ASP
- Homepage:
- Size: 59.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
- Support: SUPPORT.md
Awesome Lists containing this project
README
# Dictionary in Classic ASP
[](https://app.codacy.com/gh/R0mb0/Dictionary_classic_asp/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[](https://github.com/R0mb0/Dictionary_classic_asp)
[](https://github.com/R0mb0/Dictionary_classic_asp)
[](https://opensource.org/license/mit)[](http://paypal.me/R0mb0)
## Backgroud structure
### Arrays structure.
The dictionary is implemented as a multidimensional array, where the first dynamic array contains on every cell a fixed array of two cells.
The first fixed array cell contains the unique key and the second one contains the value.#### Chart
```mermaid
flowchart LR;
A[/0/] ==> B[/1/]
B ==> C[/2/]
C ==> D[/.../]
A --> E[0: Unique Key]
E --> F[1: Value]
B --> G[0: Unique Key]
G --> H[1: Value]
C --> I[0: Unique Key]
I --> J[1: Value]
D --> K[0: Unique Key]
K --> L[1: Value]
```
## `Dictionary.asp`'s avaible Functions
- **Initialize an array as a dictionary** -> `get_initialized_dictionary()`
- **Add an element into a dictionary** -> `add_element_to_dictionary(key,value)`
- **Get value from key** -> `get_dictionary_value_from_key(key)`
- **Set value from key** -> `set_dictionary_value_from_key(key,value)`
- **Change a key into dictionary** -> `change_dictionary_key(old_key,new_key)`
- **Remove dictionary element from key** -> `remove_dictionary_element_from_index(idx)`
- **Remove dictionary element from index** -> `remove_dictionary_element_from_index(idx)`
- **Remove last element from dictionary** -> `remove_last_element_from_dictionary()`
- **Remove elements from dictionary using indices (pass to function an array with the indices)** -> `remove_dictionary_elements_from_indices(indices)`
- **Remove all elements with the same value from dictionary** -> `remove_dictionary_elements_from_value(value)`
- **Replace all value occurrences with a new value in dictionary** -> `replace_all_value_occurrences(old_value,new_value)`
- **Get key index from dictionary** -> `get_key_index_from_dictionary(key)`
- **Reset a dictionary** -> `get_initialized_dictionary()`
- **Get dictionary key from index** -> `get_dictionary_key_from_index(idx)`
- **Get first value index occurrence** -> `get_first_value_index_occurrence(value)`
- **Get all indices of a value** -> `get_all_value_indices(value)`
- **Check if a key has been used into dictionary** -> `check_if_key_has_been_used(key)`
- **Check if a value is present in the dictionary** -> `check_if_value_is_present(value)`
- **Get dictionary value from index** -> `get_dictionary_value_from_index(idx)`
- **Get dictionary dimension** -> `get_dictionary_dimension()`
- **Write a dictionary** -> `write_dictionary()`## How to use:
> From `Test.asp`
1. Create array and initialize it as dictionary
```asp
<%
Dim dictionary
dictionary = Array()
dictionary = get_initialized_dictionary()
```
2. Pass the dictionary to functions for manage
```asp
add_element_to_dictionary_array "0001","Ice ice baby"
add_element_to_dictionary_array "0002","Dove lo vuoi tu"
add_element_to_dictionary_array "0003","Hot shot"
write_dictionary
%>
```
## `Dictionaries.asp`'s avaible Functions
- **Initialize an array as a dictionary** -> `get_initialized_dictionary()`
- **Add an element into a dictionary** -> `add_element_to_dictionary(dictionary,key,value)`
- **Get value from key** -> `get_dictionary_value_from_key(dictionary,key)`
- **Set value from key** -> `set_dictionary_value_from_key(dictionary,key,value)`
- **Change a key into dictionary** -> `change_dictionary_key(dictionary,old_key,new_key)`
- **Remove dictionary element from key** -> `remove_dictionary_element_from_index(dictionary,idx)`
- **Remove dictionary element from index** -> `remove_dictionary_element_from_index(dictionary,idx)`
- **Remove last element from dictionary** -> `remove_last_element_from_dictionary(dictionary)`
- **Remove elements from dictionary using indices (pass to function an array with the indices)** -> `remove_dictionary_elements_from_indices(dictionary,indices)`
- **Remove all elements with the same value from dictionary** -> `remove_dictionary_elements_from_value(dictionary,value)`
- **Replace all value occurrences with a new value in dictionary** -> `replace_all_value_occurrences(dictionary,old_value,new_value)`
- **Get key index from dictionary** -> `get_key_index_from_dictionary(dictionary,key)`
- **Reset a dictionary** -> `get_initialized_dictionary()`
- **Get dictionary key from index** -> `get_dictionary_key_from_index(dictionary,idx)`
- **Get first value index occurrence** -> `get_first_value_index_occurrence(dictionary,value)`
- **Get all indices of a value** -> `get_all_value_indices(dictionary,value)`
- **Check if a key has been used into dictionary** -> `check_if_key_has_been_used(dictionary,key)`
- **Check if a value is present in the dictionary** -> `check_if_value_is_present(dictionary,value)`
- **Get dictionary value from index** -> `get_dictionary_value_from_index(dictionary,idx)`
- **Get dictionary dimension** -> `get_dictionary_dimension(dictionary)`
- **Write a dictionary** -> `write_dictionary(dictionary)`## How to use:
> From `Test.asp`
1. Create array and initialize it as dictionary
```asp
<%
Dim dictionary
dictionary = Array()
dictionary = get_initialized_dictionary()
```
2. Pass the dictionary to functions for manage
```asp
add_element_to_dictionary_array dictionary,"0001","Ice ice baby"
add_element_to_dictionary_array dictionary,"0002","Dove lo vuoi tu"
add_element_to_dictionary_array dictionary,"0003","Hot shot"
write_dictionary dictionary
%>
```
## `dictionary.class.asp`'s avaible Functions
- **Add an element into a dictionary** -> `add_element(key,value)`
- **Get value from key** -> `get_value_from_key(key)`
- **Set value from key** -> `set_value_from_key(key,value)`
- **Change a key into dictionary** -> `change_key(old_key,new_key)`
- **Remove dictionary element from key** -> `remove_element_from_index(idx)`
- **Remove dictionary element from index** -> `remove_element_from_index(idx)`
- **Remove last element from dictionary** -> `remove_last_element(dictionary)`
- **Remove elements from dictionary using indices (pass to function an array with the indices)** -> `remove_elements_from_indices(indices)`
- **Remove all elements with the same value from dictionary** -> `remove_elements_from_value(value)`
- **Replace all value occurrences with a new value in dictionary** -> `replace_all_value_occurrences(old_value,new_value)`
- **Get key index from dictionary** -> `get_key_index(key)`
- **Reset a dictionary** -> Re-initialize the object
- **Get dictionary key from index** -> `get_key_from_index(idx)`
- **Get first value index occurrence** -> `get_first_value_index_occurrence(value)`
- **Get all indices of a value** -> `get_all_value_indices(value)`
- **Check if a key has been used into dictionary** -> `check_if_key_has_been_used(key)`
- **Check if a value is present in the dictionary** -> `check_if_value_is_present(value)`
- **Get dictionary value from index** -> `get_value_from_index(idx)`
- **Get dictionary dimension** -> `get_dimension()`
- **Write a dictionary** -> `write()`## How to use:
> From `Test.asp`
1. Initialize the class
```asp
<%@LANGUAGE="VBSCRIPT"%>
<%
Dim dic
Set dic = new dictionary
```
2. Use the class
```asp
dic.add_element "0001","Ice ice baby"
dic.add_element "0002","Dove lo vuoi tu"
dic.add_element "0003","Hot shot"
dic.add_element "0004","7 minuti in paradiso"
dic.add_element "0005","Dimmi dove e quando"
dic.add_element "0006","Balla per me"
dic.add_element "0007","Nudi e crudi"
dic.add_element "0008","Obbligo o verita'"
dic.add_element "0009","Sotto il vestito, niente"
dic.add_element "0010","Colazione a letto "
dic.add_element "0011","Luce dei miei occhi"
dic.add_element "0012","Comprami un giocattolo"
dic.add_element "0013","Facciamo pace"
dic.add_element "0014","Less is more"
dic.add_element "0015","call me baby"
dic.add_element "0016","Pensaci tu"
dic.add_element "0017","Souvenir d'amour"
dic.add_element "0018","Proca a prendermi"
dic.add_element "0019","Meet me at the hotel"
dic.add_element "0020","Sexy movie night"
dic.add_element "0021","Doccia bollente"
dic.add_element "0022","Blind date"
dic.add_element "0023","Oggi voglio..."
dic.add_element "0024","Nuovo blocchetto"
dic.write()
%>
```