SP File Functions

 STRIP_PATH()   Strip path and optionally extension from a filespec
 ISVALFILE()    Checks a file name for validity
 FMOVE2PRIOR()  Moves to beginning of previous CRLF delimited line in
                a text file
 FMOVE2NEXT()   Move to beginning of next line in a text file
 FILEINFO()     Returns file date,time,size
 NKEY()         Gets key of an index file
 SFREADLINE()   Reads in text up to the next CRLF in a text file
 WRITEFILE()    Writes a line or lines  to a text file

 

SP_ISVALFILE

ISVALFILE()

  Short:
  ------
  ISVALFILE() Checks a file name for validity

  Returns:
  --------
  <lValid> => is file name a valid dos file name

  Syntax:
  -------
  ISVALFILE(cName,[lCheckDup],[@cMessage])

  Description:
  ------------
  Checks the proposed file name in <cName> for
  adherance to the dos file naming conventions.

  [lCheckDup] will check for existance of the file if
  True. Default False.

  [@cMessage] a string passed by reference. The reason
  for rejection will be placed in the string. Messages returned
  are:

    "File name is empty"
    "Duplicate file exists"
    "File name is too long"
    "Too many periods"
    "Too many characters after the period"
    "Too many characters before the period"
    "Too many characters with no period"
    "Invalid character: " (character)
    "Illegal file name"

  Examples:
  ---------

   cFn := space(15)

   while .t.
     cMessage := ""
     @10,10 get cFn
     read
     @20,10 say iif(isvalfile(cFn,.t.,@cMessage),"Valid  ","Not Valid")
     @21,10 say padr(cMessage,50)
   end

  Source:
  -------
  S_ISVALF.PRG