GetFileExt$
FileExtension$ = GetFileExt$(Filename$)
 
Parameters:

    Filename$ = The filename & path you wish to grab the file extension from
Returns:

    FileExtension$ = The File Extension from the filename
 

      The GetFileExt$ functions returns the file extension from a filename.



FACTS:


      * None



Mini Tutorial:


      This example, shows how to grab the file extension, the filename, the directory folder and device name from an absolute filename.

      An absolute filename is a filename that contains the device, the directory and the filename. Like this "C:\Windows\MyFile.txt"

  
  
; Create a filename string for us to examine
  File$="C:\Windows\Temp\HelloWorld.TXT"
  
; Display the File extension from the filename
  Print GetFileExt$(File$)
  
; Display the just the FileName
  Print GetFileName$(File$)
  
; display the directory with device and folder name
  Print GetFolderName$(File$)
  
; just the device name
  Print GetDeviceName$(File$)
  
; Display the screen and wait for a key press
  Sync
  WaitKey
  
  




This example would output something like this.

  
  .TXT
  HelloWorld.txt
  C:\Windows\Temp\
C:
  

 
Related Info: GetDeviceName$ | GetFileName$ | GetFolderName$ :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com