APPX Software Library

Chapter 4-8: Runtime Subroutine's and Predefined Processes

.FILE SPLIT FILENAME

This subroutine is called to separate a filename into it's name and extension parts.

Usage:

Screen capture

Description:

This subroutine is called to separate a filename into its name and extension parts. All parameters are required, if any are missing the subroutine will CANCEL.

<filename_part> will contain the filename part (Required). This must be PASSed with Share "Y".

<extension_part> will contain the file extension part, including its leading period (Required). This must be PASSed with Share "Y".

<full_filename> is the full filename to separate (Required).

The subroutine identifies the <extension_part> by locating all the characters after the last period in <full_filename>. If there are no periods in <full_filename>, then <full_filename> will be returned in <extension_part> and <filename_part> will be empty (the entire name is considered the extension). If <full_filename> contains a leading path, that will also be returned in <filename_part>. See .FILE SPLIT PATHNAME to split the pathname from the base file name.

A 'Data was truncated' error will be returned in .FILE SPLIT FILENAME if the fields you pass are too short to contain either the file name or file extension.