Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: M. Akram Bhatti
  Where is M. Akram Bhatti?
 Riyadh
 Saudi Arabia
 M. Akram Bhatti
 To: Khurram Tahir
  Where is Khurram Tahir?
 Karachi
 Pakistan
 Khurram Tahir
 Tags
Subject: RE: Checking of Valid File name
Thread ID: 228465 Message ID: 228474 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Projects and Design
Date: Tuesday, May 19, 2009 9:32:41 AM         
   


> >
> > While saving you can check for the existence of these characters in accna and if found, not allow user to save it.
> >
> >
If "\" $ accna OR "/" $ accna OR ":" $ accna && for all characters you want to restrict
> >   MsgBox("Invalid characters found in the account name")
> >   Return .f.
> > ELSE
> >   Return .t.
> > ENDIF
> > 

> >
> > Regards,
> > Akram
>
> Q. How can i replace these character if found in Accna with space
>
> e.g.
>
>
lcAccna = Accna
> 
> lcAccna=CHRTRAN(lcAccna,'/','')

> Now here in 1 command how can i replace all not allowed charcters in file name with space

Khurram you can use CHRTRAN() too and it is simpler than STRTRAN().

lcAccna = CHRTRAN(accna, "<>|:\/", "")


Regards,
Akram

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