PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → How to determine if a filename is valid
How to determine if a filename is valid
Iniciado por guest, 12,jul. 2011 18:43 - 5 respuestas
Publicado el 12,julio 2011 - 18:43
I'm using HInfoMemo to get the original filename of photos.
Sometimes it returns non-valid characters like ╝ or├
Is there a function to check if a filename is valid, before I use HExtractMemo() to save the photo?
Publicado el 12,julio 2011 - 19:46
Hi Arie,
Unfortunately no. I made a suggestion for the other way around: to have a function that removes unauthorized characters from a file name according to the OS (ref. 72 583).
Maybe you can make a suggestion for this aspect of the question?
Best regards,
Alexandre Leclerc
Publicado el 13,julio 2011 - 10:24
Just send a suggestion to pcsoft.
Cheers.
Publicado el 15,julio 2011 - 01:37
Hi Arie
I was going to present a list of valid characters, but realised that that was for ASCII only, and hence outdated!
Microsoft gives a good explanation of which characters are valid, and which are not here:
- http://support.microsoft.com/kb/177506
- http://msdn.microsoft.com/en-us/library/aa365247%28v=vs.85%29.aspx
Cheers
Chris
Publicado el 15,julio 2011 - 11:13
Just received a response from PC-soft about this topic.
They will add it to the list of request, probably making it one of the 1234 new features of V17.
And the tip to use something like this:
MatchRegularExpression(SAI_Edit,"[A-Za-z0-9_.+]*")
which seems to be a good one!!
I wil combine that with your (microsofts) info.
Miembro registrado
71 mensajes
Publicado el 24,mayo 2016 - 08:59
I did not find any special function to check or modify a string to get correct file/dir name but I use this
NoCharacter("f*il:e"" na*:me","<>:""/\|?*",sscAll)