Please enable JavaScript to view this site.

Knowledge Base

Navigation: Scripting Language > System

fileextension

We've made some changes. Use 'Ctrl-F5' to clear your browser cache.
Scroll Prev Top Next More

Gets the file extension from a string.

 

Supported Product: FDTD, MODE, DEVICE, INTERCONNECT

 

Syntax

Description

out = fileextension( "name.ext");

Returns the file extension as a string.

 

Examples

Isolates the file extension from the full filename.

?fileextension("C:/Users/myname/Documents/FDTD/myfile.fsp");

fsp

 

Uses the following code to check with product you are using. This can be helpful if you are trying to write scripts that will be shared between multiple products.

save("myfile");

if(fileextension(currentfilename)=="fsp") { ?"Using FDTD Solutions"; }

if(fileextension(currentfilename)=="lms") { ?"Using MODE Solutions"; }

if(fileextension(currentfilename)=="ldev") { ?"Using DEVICE"; }

if(fileextension(currentfilename)=="icp") { ?"Using INTERCONNECT"; }

 

See Also

System level, currentfilename, getpath, which, pwd, filedirectory, filebasename

Copyright Lumerical Inc. | Privacy | Site Map