1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- $PBExportHeader$uo_keyvaluecollection.sru
- forward
- global type uo_keyvaluecollection from nonvisualobject
- end type
- end forward
- global type uo_keyvaluecollection from nonvisualobject
- end type
- global uo_keyvaluecollection uo_keyvaluecollection
- type variables
- Private:
- String keys[]
- String Values[]
- end variables
- forward prototypes
- public subroutine uf_add (string arg_key, string arg_value)
- public function boolean uf_haskey (string arg_key)
- public function string uf_getvalue (string arg_key)
- public subroutine uf_clear ()
- public function boolean uf_include (uo_keyvaluecollection arg_sub)
- public subroutine uf_getkeys (ref string arg_keys[])
- public subroutine uf_getvalues (ref string arg_values[])
- end prototypes
- public subroutine uf_add (string arg_key, string arg_value);Long i
- FOR i = 1 To UpperBound(keys)
- IF keys[i] = arg_key THEN EXIT
- NEXT
- IF i > UpperBound(keys) THEN
- keys[i] = arg_key
- Values[i] = arg_value
- ELSE
- Values[i] += ',' + arg_value
- END IF
- end subroutine
- public function boolean uf_haskey (string arg_key);Long i
- FOR i = 1 To UpperBound(keys)
- IF keys[i] = arg_key THEN RETURN True
- NEXT
- RETURN False
- end function
- public function string uf_getvalue (string arg_key);Long i
- FOR i = 1 To UpperBound(keys)
- IF keys[i] = arg_key THEN RETURN Values[i]
- NEXT
- String ls_null
- SetNull(ls_null)
- RETURN ls_null
- end function
- public subroutine uf_clear ();String empty_arr[]
- keys = empty_arr
- Values = empty_arr
- end subroutine
- public function boolean uf_include (uo_keyvaluecollection arg_sub);IF UpperBound(arg_sub.keys) <= 0 THEN RETURN False
- Long i
- FOR i = 1 To UpperBound(arg_sub.keys)
- IF Not This.uf_haskey(arg_sub.keys[i]) THEN RETURN False
- IF This.uf_getvalue(arg_sub.keys[i]) <> arg_sub.Values[i] THEN RETURN False
- NEXT
- RETURN True
- end function
- public subroutine uf_getkeys (ref string arg_keys[]);arg_keys = keys
- end subroutine
- public subroutine uf_getvalues (ref string arg_values[]);arg_values = values
- end subroutine
- on uo_keyvaluecollection.create
- call super::create
- TriggerEvent( this, "constructor" )
- end on
- on uo_keyvaluecollection.destroy
- TriggerEvent( this, "destructor" )
- call super::destroy
- end on
|