Created
February 20, 2020 00:33
-
-
Save jbratu/bab2085cec81f9bf954dc7b9596b57b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function CS_SIMPLE_KEY_VALUE(Action, Array, Key, Value) | |
If Action _EQC 'set' Then | |
Swap @FM With @VM In Value | |
ArrayCount = DCOUNT(Array,@FM) | |
For i = 1 To ArrayCount | |
If Array<i,1> = Key Then | |
Array<i> = Key : @VM : Value | |
Return '' | |
End | |
Next i | |
Array<ArrayCount + 1> = Key : @VM : Value | |
Return '' | |
End | |
If Action _EQC 'get' Then | |
ArrayCount = DCOUNT(Array,@FM) | |
For i = 1 To ArrayCount | |
If Array<i,1> = Key Then | |
Entry = Array<i> | |
Entry = Entry[Len(Key)+2,Len(Entry)] | |
Swap @VM With @FM In Entry | |
Return Entry | |
End | |
Next i | |
Return '' | |
End |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment