2.2.4.42.9 storage::SetSection

Description

Copy a TreeNode branch into a storage section. Section is created if not already present

Syntax

BOOL SetSection( LPCSTR lpcszSecName, TreeNode & trNode )

Parameters

lpcszSecName
[input]name of an existing section or a new section, must be valid C identifier name
trNode
[input]a TreeNode to set the data

Return

Returns TRUE on success and FALSE on failure.

Examples

EX1

void storage_SetSection_ex1()
{
    Page pg = Project.Pages();
    if(pg == NULL)
       return;
    
    string strStorage = "Test";
    string strSection = "Params";
    
    Tree trTemp;
    trTemp.AA.factor.dVal = 1.2345;
    trTemp.AA.title.strVal = "This is a test";
    trTemp.BB.nOrder.nVal = 2;
    trTemp.BB.decay.dVal = 4.32;
    
    pg.Info.Add(strStorage);
    storage st;
    st = pg.GetStorage(strStorage);
    if(st)
    {
        if(st.SetSection(strSection, trTemp))
            out_str("done");
    }
}

Remark

See Also

Storage::GetSection, Storage::DeleteSection

Header to Include

origin.h