GetName
Get the name of a folder
Return the name of a folder to a string reference
string GetName( )
BOOL GetName( string & strName )
Returns the name of a folder to a string
TRUE on success, FALSE if the folder is not valid.
EX1
// Try to create two subfolders of root using the same name // Illustrates getting actual name of folder which was created void Folder_GetName_Ex1() { Folder fldRoot("/"); Folder fldMyFolder(); fldMyFolder = fldRoot.AddSubfolder("MyFolder"); if( fldMyFolder.IsValid() ) { string strCurrFld = fldMyFolder.GetName(); printf("The folder name is \"%s\"\n", strCurrFld); } else printf("Problem in creation of /MyFolder\n"); fldMyFolder = fldRoot.AddSubfolder("MyFolder"); if( fldMyFolder.IsValid() ) { string strCurrFld = fldMyFolder.GetName(); printf("The folder name is \"%s\"\n", strCurrFld); } else printf("Problem in creation of /MyFolder\n"); }
EX2
// Another method of getting a folder name using a string reference void Folder_GetName_Ex2() { Folder fld = Project.ActiveFolder(); string strName; if( fld.GetName(strName) ) printf("Current folder is: %s", strName); }
Get the name of the folder.
origin.h