Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- SuperLib 3.50 - function isvalfile() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FUNCTION 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


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson