<cAppConfig>.LoadString

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Modules > AppConfig > cAppConfig Class > <cAppConfig> Methods >

<cAppConfig>.LoadString

 

Description

 

Parse and load key/values data pair from a valid AppConfig XML buffer string.

 

Syntax

 

Syntax

 

n = <cAppConfig>.LoadString(XMLStringBuffer)

 

Returns

 

Number

 

Parameters

 

Name

Type

Optional

Meaning

XMLStringBuffer

String

No

A valid AppConfig XML buffer.
 

Do not include XML header <?xml version="1.0" encoding="utf-8"?>

but start directly with <AppConfig> node

 

 

Remarks

 

Restrictions

 

See also

 

Examples

 

See cAppConfig example

 

 
uses "AppConfig"
 
string lXMLConfig = "

                      <AppConfig>

                         <!--this is a comment-->

                         <AppVersion>1.0.0</AppVersion>

                         <AppData>

                            <Version>1.0</Version>

                            <Author_eMail>support@thinbasic.com</Author_eMail>

                            <Author_WebSite>http://www.thinbasic.com</Author_WebSite>

                         </AppData>

 

                         <AppFiles>

                            <File1>NameFile1.txt</File1>

                            <File2>NameFile2.txt</File2>

                         </AppFiles>

 

                         <Buffers>

                            <Buffer1><![CDATA[some stuff]]></Buffer1> <!-- Comment -->

                         </Buffers>

 

                      </AppConfig>
                    "
 
dim appConfig as new CAPPCONFIG
 
appConfig.LoadString(lXMLConfig)
if appConfig.ErrorPresent Then 
  ' appConfig.ErrorDescription
Else
  ' appConfig.ErrorDescription
end If