scripting@wanadoo.nl




GetFileExt()

http://www.scriptlogic.com/kixtart/FunctionLibrary_FunctionList.aspx


actual FunctionLibrary list on 'Scriptlogic' site printer-friendly mirror of UDF topic on 'scripting@wanadoo.nl' site close
9 January 2002 GetFileExt()
AuthorScriptLogic Corporation
Action Returns only the filename's extension, given a filespec.
SyntaxGetFileExt ( "filespec" ) 
Parameters
  • filespec (Required / String) The filespec you wish to extract the filename's extension from. 
  • RemarksComplimentary to the GetFileName() and GetFilePath() UDFs.
    Requires KiXtart 2001 (4.0) final due to InstrRev() function. 
    ReturnsReturns the filename's extension extracted from the filespec. If there is no extension, an empty string is returned. 
    DependenciesNone. 
    Examples
    ? GetFileExt('%temp%\myfile.txt')
    ? GetFileExt('myfile.txt')
    ? GetFileExt('\\server\share\myfile.html')
    
     
    Source
    FUNCTION GetFileExt ($filespec)
      ; Author: ScriptLogic Corporation
      ; Last revised: 17-Nov-2001
      ; returns filename's extension
      ; requires that the filename has an extension
      DIM $dot
      $getfileext=''
      $dot=InStrRev($filespec,'.')
      IF $dot
        $getfileext=Substr($filespec,$dot+1)
      ENDIF
    ENDFUNCTION ; - GetFileExt -
     
      original source of UDF topic. show actual FunctionLibrary list on Scriptlogic site close top
              printer-friendly mirror of UDF topic on scripting@wanadoo.nl site  




    Copyright © 2003 www.scriptlogic.com & scripting@wanadoo.nl - last updated on 20 May 2003


    Site Meter