cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
seaktf
Level 4

Built-in function to check for valid file/folder name?

I'm asking this question to make sure I'm not reinventing the wheel.

In a dialog of my setup, users are asked to enter a string which will be used to create a subfolder's name later. Is there any built-in function to check if the string contains valid characters for folder name? You know, eg * > / are not allowed in a folder's name.

Well, I've looked through string functions and file/folder functions and can't find any. All I could make up so far is this:
Is(VALID_PATH, WINDISK ^ szDir)
where szDir contains the string to check.

Is there any case where this could fail to check the validity of folder name?
Labels (1)
0 Kudos
(1) Reply
Kramer
Level 3

I do almost the exact same thing to specify (and create if necessary) a transfer folder on a project and it works fine. I also trap the CreateDir call for error conditions just in case though.

If you wanted to be really paranoid couldn't you do a series of 'StrReplace' calls for each invalid character to just remove them all? There arn't that many (http://support.microsoft.com/kb/909264).
0 Kudos