
Returns the extension of a file.
FileExtension (filename)
(s) filename [optional path]full file name, including extension.
(s) file extension.
This function parses the passed filename and returns the extension part of the filename.
; prevent the user from editing a COM or EXE file
allfiles = FileItemize("*.*")
editfile = AskItemlist("Select file to edit", allfiles, @TAB, @UNSORTED, @SINGLE, @FALSE)
ext = FileExtension(editfile)
If (ext == "COM") || (ext == "EXE")
Message ("Sorry", "You may not edit a program file")
Else
DirChange(DirWindows(0))
Run("notepad.exe", editfile)
EndIf