The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 check an existing subfolder

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
billaravi Posted - 05/18/2005 : 04:03:46 AM
Origin Version (7.0):
Operating System:XP PRO

Hi
I have a situation where i need to create sunfolders in a project. But before creating i need to verify if a subfolder already exists by that name, so that i wont be creating duplicates of the subfolder. If the subfolder exists i will activate that folder and do operations with in that and if it does not i will create one. how do i go about doing this ?

cheers
ravi
1   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 05/18/2005 : 09:15:27 AM
Recall that the IsValid() method can be used on many objects, so you could use code like the following:

Folder fld = Project.RootFolder;
Folder fldsub = fld.Subfolders("MyFolder");
if( fldsub.IsValid() )
printf("Found the subfolder of root named 'MyFolder'\n");
else
{
printf("Not found. Creating ...'MyFolder'\n");
fldsub = fld.AddSubfolder("MyFolder");
}



The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000