Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- GT_LIB v1.0 Reference Guide Release 1.0 - <b>give a file name a default extension.</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Give a file name a default extension.
------------------------------------------------------------------------------

 Syntax

        GT_DefExt(<cFileName>,[<cDefExt>]) --> cNewFileName

 Arguments:

      <cFileName> is the file name to be checked.

      <cDefExt> is an optional character paramater which is the
      extension to add to the file. This can be in the format of
      `.xxx' or just `xxx'. If not supplied the default is "".

 Returns:

      The file name as it was if it had an extension, or the file name
      with the default extension if it didn't have one.

 Description:

      GT_DefExt() can be used to supply a default extension to a file.
      This can be of use in file i/o functions or for tidying up user
      input.

 Examples:

      // Get a file name form the user and default the extension.

      cFileName := space(12)
      @ 10,10 say "File To Open:" get cFileName picture "!!!!!!!!!!!!"
      read
      cFileName := GT_DefExt(cFileName,"DBF")

 Source: DEFEXT.PRG

 Author:  Dave Pearson

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