FNAME
Jump to navigation
Jump to search
forms a full filename from its components
<LABEL> - Results label to hold the full filename <AREA> - Midas software branch (HOST, CFG, DAT, etc) or aux name if <OPT>=AUX <NAME> - Filename (MYFILE, DEMUX, etc.) <EXT> - Filename extension ("txt", "mm", etc.) <OPT> - Option name (SYS, UCL, DSP, etc.) or "AUX" This command splices together a filename unique to the OS and option area selected. The root of an option tree can be found by entering empty strings for <AREA>, <NAME> and <EXT>. If <OPT> is set to AUX, <area> is assumed to be a data auxiliary, otherwise it is assumed to be a subdirectory of the named option tree. Since NeXtMidas 3.5.4, the WRITE AUX path is now fully resolved. If the /PARSE switch is present, the command works in reverse with ONE IMPORTANT DIFFERENCE - The <AREA> arg will actually contain the path. No attempt is made to relate this to an area. Given a fully specified filename in <LABEL>, the components will be written into the results names specified in the <AREA>, <NAME>, and <EXT> slots where: <AREA> - Is the file path <NAME> - Is the file root name (without extension) <EXT> - Is the file extension Examples: To find the ROOT directory of the SYS option tree: nM> FNAME sysDir AREA="" NAME="" EXT="" OPT=SYS To parse the filename in the results myfile into its path, name, and ext nM> FNAME/PARSE myfile itspath itsname itsextension To name a file in the users home directory: nM> FNAME myfile HOME mymacro mm AUX To name a file in the users write directory: nM> FNAME myfile WRITE log txt AUX Note: Since NeXtMidas 3.5.4, the path is fully resolved. nM> res myfile 24S: MYFILE = \midas\data1\usr\log.txt To name a file in aux=99 directory: nM> FNAME myfile 99 world prm AUX To open some java code from the macro language nM> FNAME mycode prim plot java sys nM> FILE open/t myfile mycode You can also reference a file in the software tree directly using the "nxm dot" package syntax: nM> FILE open/t myfile nxm.sys.prim.plot.java Switches: /FNCASE= - Sets the FileName case-sensitivity (LowerCase,KeepCase,AutoCase) similar to the FNCASE= qualifier. This only applies when /PARSE is *not* used. (Since NeXtMidas 3.3.1) /PARSE - Parse the file given by <LABEL> into its path (<AREA>), root name and extension. FileName case-sensitivity can be set via the FNCASE= qualifier on the file name passed in. See Also: FILE FUNC=NAME