Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find a valid Name of Folder
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01288621
Message ID:
01288623
Views:
20
This message has been marked as the solution to the initial question of the thread.
>Hi all,
>
>I want a function to find a valid name of fich to record on HDD.
>This name of fich is a compagny Name.
>
>
>cCompagnyName = [Résidence "la belle fleur" ( * Sanatorium ) ]
>Must be
>cCompgnyFich = [Résidence la belle fleur ( Sanatorium ) ]
>
>
>
>Thank in advance for help
>
>Bernhart

Write your own where remove all BAD chars:
cCompagnyName = [Résidence "la belle fleur" ( * Sanatorium ) ]
?ValidFolderName(cCompagnyName)

FUNCTION ValidFolderName(lcFolderName)

LOCAL lcBadChars
lcBadChars = ["'*?/\] && Add all chars you want to remove here
lcFolderName = CHRTRAN(lcFolderName,lcBadChars,[])
DO WHILE AT([  ], lcFolderName) # 0 && Remove all double spaces
   lcFolderName = STRTRAN(lcFolderName,[  ],[ ])
ENDDO
RETURN lcFolderName
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform