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

 

2 responses to “SP_ISVALFILE

  1. Pingback: SP File Functions | Viva Clipper !

  2. Pingback: SP Functions | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.