<cOptions>.Merge

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Core Language > Data Structures > cOptions > cOptions Methods >

<cOptions>.Merge

 

Description

 

Merge one or more cOptions objects.

 

Syntax

 

<cOptions>.Merge( cOptions1 [, cOptions2 [, ...]])

 

Returns

 

None

 

Parameters

 

Name

Type

Optional

Meaning

cOptions...



One cOption object





 

Remarks

 

<cOptions> will contain its keys and all the keys present in cOptions1 + cOptions2 + ...

Imported values will replace current values if key name is the same (case insensitive)

 

Restrictions

 

See also

 

Examples

 
dim lErrorSet1 as new cOptions
lErrorSet1.Add(
                 AppConfig_LoadError      :   10,
                 DBConnection_Open_Error  :  110,
                 DBRecordset_Open_Error   : 1120,
               )
 
dim lErrorSet2 as new cOptions
lErrorSet2.Add(
                 xxx           :   10,
               )
dim lErrorSet3 as new cOptions
lErrorSet3.Add(
                 yyyyyyy       :   20,
               )
 
lErrorSet1.Merge lErrorSet2, lErrorSet3
msgbox 0, lErrorSet1.ToString

 

'---Output will be:
' lErrorSet1 after merge: {
'         "XXX": "10",
'         "YYYYYYY": "20",
'         "APPCONFIG_LOADERROR": "10",
'         "DBCONNECTION_OPEN_ERROR": "110",
'         "DBRECORDSET_OPEN_ERROR": "1120"
' }