Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Joseph Agarpao
  Where is Joseph Agarpao?
 Manila
 Philippines
 Joseph Agarpao
 To: Khurram Tahir
  Where is Khurram Tahir?
 Karachi
 Pakistan
 Khurram Tahir
 Tags
Subject: RE: Checking of Valid File name
Thread ID: 228465 Message ID: 228477 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Projects and Design
Date: Tuesday, May 19, 2009 9:44:11 AM         
   


> Q1. I have a field name Accna C 30 contains any character , i want to use this field data as name of a File of any format
>
> Following charcters not allowed as File name , How can i check & remove these character from my field Accna while saving as File name
>
> \,/,:,*,?,",<,>,|


Khurram Bhai!

You may try this procedure.


accna='This*is*the>filename'
invalidchars='\/:*?,"<>|'
newaccna=''


FOR a=1 TO LEN(accna)
currentletter=SUBSTR(accna,a,1) && determine the letter to be tested
IF currentletter $ invalidchars
MESSAGEBOX('An invalid character ' + currentletter + ' found!',16,'Error Message')
ELSE
newaccna=newaccna + currentletter
ENDIF
ENDFOR
MESSAGEBOX('Test result: ' + newaccna,64,'Message')


hope it helps!

Joseph Agarpao
I may not be an expert but I have satisfied a lot of users.

ENTIRE THREAD

Checking of Valid File name Posted by Khurram Tahir @ 5/19/2009 8:43:45 AM
RE: Checking of Valid File name Posted by M. Akram Bhatti @ 5/19/2009 8:53:57 AM
RE: Checking of Valid File name Posted by Khurram Tahir @ 5/19/2009 8:59:32 AM
RE: Checking of Valid File name Posted by M. Akram Bhatti @ 5/19/2009 9:06:26 AM
RE: Checking of Valid File name Posted by Borislav Borissov @ 5/19/2009 10:00:41 AM
RE: Checking of Valid File name Posted by M. Akram Bhatti @ 5/19/2009 9:32:41 AM
RE: Checking of Valid File name Posted by Joseph Agarpao @ 5/19/2009 9:44:11 AM
RE: Checking of Valid File name Posted by tushar @ 5/19/2009 10:57:52 AM