Topic
String as a folder name
- This topic has 2 replies and 2 voices and was last updated 21 years, 4 months ago ago by jasmina.zlender@erl16.siemens.de.
-
AuthorPosts
-
13.01.2004 at 19:40 #33405jasmina.zlender@erl16.siemens.deParticipant
There is a string in FlexPro formula. How can I ask if there is a folder that has this string as name?In VBA I use is Nothing operator in such cases.
13.01.2004 at 20:25 #33403jasmina.zlender@erl16.siemens.deParticipantThere is a string in FlexPro formula. How can I ask if there is a folder that has this string as name?In VBA I use is Nothing operator in such cases.
13.01.2004 at 20:25 #33404Bernhard KantzParticipantA possible solution could be the following: Create a new formula, rename it to [b]IsFolder[/b] and paste the following text into the formula editor:
[code]
arguments strFolder
dim Errtry
$strFolder : “.FLD”$.Name
catch Err
return FALSE
Endreturn TRUE
[/code]
Then you could call this helper formula like this:
[code]
If IsFolder(“Folder”) Then …
If IsFolder(“AFolderAnotherFolder”) Then …
[/code]
The formula [b]IsFolder[/b] tries to convert the object name into a reference to the object. If the object exists this is possible and accessing the [b]Name[/b] property of the folder is a valid operation. Otherwise an error will occur which will be catched by the [b]catch[/b] statement. The variable [b]Err[/b] contains the error message as a string, but we do not need it here.Support
support@weisang.com -
AuthorPosts
- You must be logged in to reply to this topic.