<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.ice-online.com/index.php?action=history&amp;feed=atom&amp;title=NXM_Help_SHELL</id>
	<title>NXM Help SHELL - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.ice-online.com/index.php?action=history&amp;feed=atom&amp;title=NXM_Help_SHELL"/>
	<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=NXM_Help_SHELL&amp;action=history"/>
	<updated>2026-06-04T23:11:11Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.ice-online.com/index.php?title=NXM_Help_SHELL&amp;diff=588&amp;oldid=prev</id>
		<title>ConvertBot: Created page with &quot;&lt;div style=&quot;background-color: #eef9ff; border: 1px solid #999; padding: 10px;&quot;&gt;&amp;uarr; ''Go to the full list of NXM Help pages''.&lt;/div&gt; &lt;onlyinclude&gt; === ONLINE_HE...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=NXM_Help_SHELL&amp;diff=588&amp;oldid=prev"/>
		<updated>2020-04-27T18:39:28Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;div style=&amp;quot;background-color: #eef9ff; border: 1px solid #999; padding: 10px;&amp;quot;&amp;gt;&lt;a href=&quot;/NXM_Help&quot; title=&quot;NXM Help&quot;&gt;↑ &amp;#039;&amp;#039;Go to the full list of NXM Help pages&amp;#039;&amp;#039;&lt;/a&gt;.&amp;lt;/div&amp;gt; &amp;lt;onlyinclude&amp;gt; === ONLINE_HE...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;div style=&amp;quot;background-color: #eef9ff; border: 1px solid #999; padding: 10px;&amp;quot;&amp;gt;[[NXM_Help|&amp;amp;uarr; ''Go to the full list of NXM Help pages'']].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
=== ONLINE_HELP - LENDING A HELPING HAND&amp;lt;span id=&amp;quot;ONLINE_HELP&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
LENDING A HELPING HAND&lt;br /&gt;
&lt;br /&gt;
NeXtMidas has an enormous amount of on-line help, ranging from descriptions of&lt;br /&gt;
commands to on-line documentation for internal library routines. &lt;br /&gt;
&lt;br /&gt;
A brief summary of available help:&lt;br /&gt;
&lt;br /&gt;
Command			Description&lt;br /&gt;
--------------		------------------------&lt;br /&gt;
MENU			lists commands by name and/or support&lt;br /&gt;
&lt;br /&gt;
EXPLAIN &amp;lt;command&amp;gt;	describes &amp;lt;command&amp;gt;&lt;br /&gt;
DEFAULT &amp;lt;command&amp;gt;	lists default values for &amp;lt;command&amp;gt;&lt;br /&gt;
&lt;br /&gt;
HELP			shows list of HELP categories&lt;br /&gt;
HELP &amp;lt;category&amp;gt;		lists routines, switches, or qualifiers in &amp;lt;category&amp;gt;&lt;br /&gt;
HELP &amp;lt;routine&amp;gt;		gives on-line documentation for &amp;lt;routine&amp;gt;&lt;br /&gt;
HELP/GUI		a graphics interface to EXPLAIN and HELP&lt;br /&gt;
&lt;br /&gt;
The HELP GUI is an simple way for beginners to learn their way around NeXtMidas.&lt;br /&gt;
It is also helpful to Midas veterans who need to look up a detail or two &lt;br /&gt;
without interrupting their current session.  Give it a try! &lt;br /&gt;
&lt;br /&gt;
=== SHELL - THE SHELL THAT WASN'T&amp;lt;span id=&amp;quot;SHELL&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
THE SHELL THAT WASN'T&lt;br /&gt;
&lt;br /&gt;
One of the best features of the NeXtMidas shell is that you don't have to be&lt;br /&gt;
&amp;quot;in&amp;quot; the shell to use it.  All you have to do is type &lt;br /&gt;
&lt;br /&gt;
nmstart &lt;br /&gt;
&lt;br /&gt;
at your operating system prompt and NeXtMidas is &amp;quot;set up&amp;quot;.  nmstart will also&lt;br /&gt;
execute a user macro named %nmstartup at this time, if it exists.  %nmstartup&lt;br /&gt;
is to NeXtMidas what LOGIN.COM is to VMS and .login (not .cshrc) is to UNIX. &lt;br /&gt;
&lt;br /&gt;
As long as NeXtMidas has been started with nmstart, you can send commands to&lt;br /&gt;
NeXtMidas right from your operating system prompt, if you so desire.&lt;br /&gt;
([[NXM_Help_SHELL#ONESHOT|See HELP ONESHOT]] to see how this is done.) &lt;br /&gt;
&lt;br /&gt;
But since there are a lot of nice reasons to work in the NeXtMidas shell&lt;br /&gt;
(see HELP FEATURES and the User's Guide), you might want to jump in by typing &lt;br /&gt;
&lt;br /&gt;
nm &lt;br /&gt;
&lt;br /&gt;
Now what?  Are you divorced from your operating system?  Must you exit to&lt;br /&gt;
perform any operating system command?  Certainly not.  Just type the&lt;br /&gt;
operating system command at the NeXtMidas prompt as you would at your normal&lt;br /&gt;
operating system prompt.  If the first word of the command is not in the&lt;br /&gt;
NeXtMidas dictionary, the command will pass through to the operating system&lt;br /&gt;
beneath.  If there is an NeXtMidas command with the same name as an operating&lt;br /&gt;
system command and you want to use the operating system's version, just&lt;br /&gt;
precede it with a dollar sign ($).  In other words, if you are operating in&lt;br /&gt;
VMS and you want to use the VMS HELP facility rather than the NeXtMidas HELP,&lt;br /&gt;
say &lt;br /&gt;
&lt;br /&gt;
 NeXtMidas&amp;gt; $help &lt;br /&gt;
&lt;br /&gt;
There is almost no reason to have to jump in and out of the NeXtMidas shell in&lt;br /&gt;
order to work back and forth between NeXtMidas and the operating system. &lt;br /&gt;
&lt;br /&gt;
See also:  HELP RUN_OS, HELP ONESHOT &lt;br /&gt;
&lt;br /&gt;
=== ONESHOT - Oneshot mode is a method by which NeXtMidas commands can be performed from your&amp;lt;span id=&amp;quot;ONESHOT&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
Oneshot mode is a method by which NeXtMidas commands can be performed from your&lt;br /&gt;
operating system prompt.  This is nice if you do most of your work in the&lt;br /&gt;
operating system and only need NeXtMidas for one or two things; it is very&lt;br /&gt;
attractive if you need to get at an NeXtMidas command from within an operating&lt;br /&gt;
system script. &lt;br /&gt;
&lt;br /&gt;
The standard way of invoking a oneshot command, which works both on VMS&lt;br /&gt;
and UNIX, is to precede the normal NeXtMidas command with &amp;quot;nm&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 nm waveform s1&lt;br /&gt;
&lt;br /&gt;
Please note that oneshot mode STILL REQUIRES that you have done an &amp;quot;nmstart&amp;quot;&lt;br /&gt;
to initialize a session, and you should do an &amp;quot;nm end&amp;quot; when you are done.&lt;br /&gt;
&lt;br /&gt;
Also beware of &amp;quot;vanishing metacharacters&amp;quot;:  since you are executing from&lt;br /&gt;
the O/S shell, it may process and remove things like double quotes on its&lt;br /&gt;
own.  There is no way around this in DCL.&lt;br /&gt;
&lt;br /&gt;
With UNIX, it is usually safest just to enclose the entire command in single&lt;br /&gt;
quotes, so that everything inside will be preserved as literal:&lt;br /&gt;
&lt;br /&gt;
 nm 'say &amp;quot;hello&amp;quot;'&lt;br /&gt;
&lt;br /&gt;
=== INTERACTIVE - THE OLD SHELL GAME&amp;lt;span id=&amp;quot;INTERACTIVE&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
THE OLD SHELL GAME&lt;br /&gt;
&lt;br /&gt;
Although you can issue commands from either within the shell or outside of&lt;br /&gt;
it, there are several interactive features of the NeXtMidas shell that make it&lt;br /&gt;
preferable to work from inside it.  (All of the other features work from&lt;br /&gt;
either inside OR outside the NeXtMidas shell.) &lt;br /&gt;
&lt;br /&gt;
Total Recall ============== &lt;br /&gt;
&lt;br /&gt;
One of these is command recall with a keystroke.  By hitting the up arrow,&lt;br /&gt;
you can recall the last command you just typed and get a chance to edit it&lt;br /&gt;
before issuing it again.  Hitting the up arrow repeatedly moves you further&lt;br /&gt;
back through the history of commands for this NeXtMidas session.  Hitting the&lt;br /&gt;
down arrow moves you &amp;quot;forward&amp;quot; through the list. &lt;br /&gt;
&lt;br /&gt;
There is also recall ability which will recall any recent command beginning&lt;br /&gt;
with the letters of its argument.  For example, &lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt;!wave&lt;br /&gt;
&lt;br /&gt;
will recall the most recent command beginning with &amp;quot;wave&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Before hitting &amp;lt;RETURN&amp;gt; to send a command, the line itself can be edited with&lt;br /&gt;
the following keys: &lt;br /&gt;
&lt;br /&gt;
Left and Right Arrow Keys -&lt;br /&gt;
 	move your cursor left and right through the command.&lt;br /&gt;
CTRL-A        - toggles insert mode.&lt;br /&gt;
CTRL-H (Home) - jumps cursor to beginning of line&lt;br /&gt;
CTRL-E (End)  - jumps cursor to end of line&lt;br /&gt;
CTRL-U         - deletes the entire line&lt;br /&gt;
&lt;br /&gt;
(VAX) CTRL-J		Delete word&lt;br /&gt;
(UNIX) CTRL-W		Delete word&lt;br /&gt;
&lt;br /&gt;
If you are a SunOS UNIX user, you may have found that when you are using an&lt;br /&gt;
OpenWindows shelltool with the scrollbar turned on, the arrow keys do not&lt;br /&gt;
work.  The following aliases are provided for UNIX users: &lt;br /&gt;
&lt;br /&gt;
CTRL-P (Previous) or CTRL-B (Back) - Up Arrow&lt;br /&gt;
CTRL-N (Next)			   - Down Arrow&lt;br /&gt;
CTRL-F (Forward)		   - Right Arrow&lt;br /&gt;
CTRL-D				   - Left Arrow&lt;br /&gt;
&lt;br /&gt;
When using a shelltool with a scrollbar, you should also be aware that when&lt;br /&gt;
insert mode is on, it will not look like you are inserting characters even&lt;br /&gt;
though you are. &lt;br /&gt;
&lt;br /&gt;
See also:  EXPLAIN HISTORY.&lt;br /&gt;
&lt;br /&gt;
Looking For An Argument ===== &lt;br /&gt;
&lt;br /&gt;
Many NeXtMidas commands have a large number of arguments.  You can use the DEFAULT&lt;br /&gt;
command to help you out here, but one even more useful shell feature will prompt you&lt;br /&gt;
for each argument in turn. &lt;br /&gt;
&lt;br /&gt;
Simply end the command (however much you've typed) with a question mark (?)&lt;br /&gt;
and hit &amp;lt;RETURN&amp;gt;.  NeXtMidas will give the meaning of each argument, one line&lt;br /&gt;
at a time, together with its default value.  When you have &amp;quot;answered&amp;quot; each&lt;br /&gt;
one, NeXtMidas will show you the command it has built. You can edit it further&lt;br /&gt;
if necessary before hitting &amp;lt;RETURN&amp;gt; to send the command. &lt;br /&gt;
&lt;br /&gt;
If for some reason you need a final literal question mark for your command,&lt;br /&gt;
just end your command with two (??) and they will be translated to one.  No&lt;br /&gt;
command prompting will take place. &lt;br /&gt;
&lt;br /&gt;
=== CALCULATIONS - A CALCULATED ADVANTAGE&amp;lt;span id=&amp;quot;CALCULATIONS&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
A CALCULATED ADVANTAGE&lt;br /&gt;
&lt;br /&gt;
One of the most heavily used features of NeXtMidas is its ability to perform&lt;br /&gt;
in-line calculations.  You can stick a complex mathematical formula or &lt;br /&gt;
logical tests anywhere a single number would go; this formula can even &lt;br /&gt;
include the names of numeric results parameters, as they are interpreted &lt;br /&gt;
as symbolic numeric constants. For example, the command &lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; waveform OUT=s1 PHASE=2*pi+(3/4)-phase&lt;br /&gt;
&lt;br /&gt;
produces exactly the same effect as&lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; calc frequency 2 pi * 3 4 / + phase -&lt;br /&gt;
 nM&amp;gt; waveform out=s1 freq=frequency&lt;br /&gt;
&lt;br /&gt;
(assuming, of course, that PI and PHASE are results parameters set ahead of&lt;br /&gt;
time to numeric values.) &lt;br /&gt;
&lt;br /&gt;
You can always write any number in scientific or engineering notation. For&lt;br /&gt;
example, 2.146 x 10^7 is written in NeXtMidas as  2.146e7 .  If you think in&lt;br /&gt;
multiples of 10^3, as in 21.46 MHz, you can write that as 21.46e6 .  165.2 mA&lt;br /&gt;
can be 165.2e-3 .  NeXtMidas takes care of it all. &lt;br /&gt;
&lt;br /&gt;
Certain applications work well with powers of two (or multiples thereof)&lt;br /&gt;
rather than powers of ten.  You may find yourself often wanting to write&lt;br /&gt;
values such as 2**10 or 3*(2**20).  Two short NeXtMidas abbreviations are K for&lt;br /&gt;
2**10 and M for 2**20.  9k means 9*(2**10) and .6M means 0.6*(2**20). &lt;br /&gt;
&lt;br /&gt;
The available operators for in-line calculations are:  addition (+),&lt;br /&gt;
subtraction (-), multiplication (*), division (/), and exponentiation (**). &lt;br /&gt;
You can also use parentheses to group expressions.  For more sophisticated&lt;br /&gt;
functions such as logarithm or minimum, use the CALCULATOR intrinsic in-line&lt;br /&gt;
via the syntax:&lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; sincosine s1 ,,,, calc(phase,0,max,360,min)&lt;br /&gt;
&lt;br /&gt;
The arguments for the calc() inline function are the same as the CALCULATOR &lt;br /&gt;
intrinsic.  The logical() inline function supports all of the tests available&lt;br /&gt;
with the IF and WHILE intrinsics, returning a 1 for true and 0 for false.&lt;br /&gt;
&lt;br /&gt;
For example, the following command sets SINCOSINE's phase parameter to 180 &lt;br /&gt;
degrees if A is greater than B or the file INVFILE exists, and zero if not.&lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; sincosine s1 ,,,, 180*logical(A,gt,B,or,INVFILE,fexists)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can also directly use the values of existing switches in calculations.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; calc/sw=45 ans 10*/sw+3&lt;br /&gt;
 ANS = 453.00000000000&lt;br /&gt;
&lt;br /&gt;
The contents of a Midas file's header control block is also available in &lt;br /&gt;
a results like syntax for inline calculations via the syntax:&lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; constant outfile template(hcb.f) template(hcb.sz) 0 0 &amp;amp;&lt;br /&gt;
 	template(hcb.xs) template(hcb.xd) template(hcb.xu)&lt;br /&gt;
 nM&amp;gt; results outfile(hcb.key.comment) template(hcb.key.comment)&lt;br /&gt;
&lt;br /&gt;
where &amp;quot;template&amp;quot; is a Midas file.  See HELP FEATURES VECTORED for more.&lt;br /&gt;
&lt;br /&gt;
A few words of caution:&lt;br /&gt;
&lt;br /&gt;
1.  The precedence of operators in any in-line calculation is strictly &lt;br /&gt;
left to right.  In other words, 2+4*5 will evaluate to 30, not 22.  Use&lt;br /&gt;
parentheses whenever you want to indicate a different precedence. &lt;br /&gt;
&lt;br /&gt;
2.  Never put any spaces in the middle of an in-line calculation. Spaces and&lt;br /&gt;
commas separate arguments in NeXtMidas, and you want the entire calculation to&lt;br /&gt;
be perceived as a single argument. &lt;br /&gt;
&lt;br /&gt;
3.  In-line calculations usually fail as you would expect with strings that&lt;br /&gt;
are incomplete or don't make sense, such as &amp;quot;100**&amp;quot; or &amp;quot;+*/&amp;quot;.  But some&lt;br /&gt;
strings that seem to be nonsensical sometimes have an interpretation; for&lt;br /&gt;
example, &amp;quot;100+/&amp;quot; evaluates to 99, since the &amp;quot;/&amp;quot; is taken to be a switch&lt;br /&gt;
reference (it is not preceded by an operand) to a switch with no name.  A&lt;br /&gt;
no-name switch is considered absent and therefore has the value of -1.&lt;br /&gt;
100 + -1 = 99.&lt;br /&gt;
&lt;br /&gt;
See Also:  EXPLAIN CALC&lt;br /&gt;
&lt;br /&gt;
=== SUBSTITUTION - ACCEPTING SUBSTITUTES&amp;lt;span id=&amp;quot;SUBSTITUTION&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
ACCEPTING SUBSTITUTES&lt;br /&gt;
&lt;br /&gt;
One use of results parameters (see EXPLAIN RESULTS) is just to store values&lt;br /&gt;
so you can look at them.  But the most powerful use of them is to substitute&lt;br /&gt;
their values for their names wherever those names appear. &lt;br /&gt;
&lt;br /&gt;
Often, the value of the result gets substituted automatically.  For example,&lt;br /&gt;
if a name is given where a number is required, NeXtMidas searches for a numeric&lt;br /&gt;
result with that name, and if found, substitutes it value. &lt;br /&gt;
&lt;br /&gt;
You can also store ASCII strings (such as filenames) in result parameters. &lt;br /&gt;
The following: &lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; res fname sine1&lt;br /&gt;
 nM&amp;gt; sincos fname&lt;br /&gt;
&lt;br /&gt;
is equivalent to&lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; sincos sine1&lt;br /&gt;
&lt;br /&gt;
If the ASCII result exists, it is substituted.  If FNAME was the name of a&lt;br /&gt;
numeric results parameter, its value would not be substituted and the sine&lt;br /&gt;
wave would have been written to a file named FNAME. &lt;br /&gt;
&lt;br /&gt;
But sometimes the substitution is not automatic and you have to force it. One&lt;br /&gt;
major example is the forcing of substitution within double quotes. Normally&lt;br /&gt;
NeXtMidas does not look at anything inside double quotes; it will not uppercase&lt;br /&gt;
anything, remove any spaces, or substitute any result parameters. (See HELP&lt;br /&gt;
METACHAR for more information.) But by preceding the name of a result with a&lt;br /&gt;
caret(^), you can force result substitution anywhere. The command: &lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; say &amp;quot;The value of FNAME is ^FNAME.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
will produce&lt;br /&gt;
&lt;br /&gt;
The value of FNAME is SINE1.&lt;br /&gt;
&lt;br /&gt;
Some commands expect the name of a results parameter, not the value of one. &lt;br /&gt;
For example, STATUS can write various fields of the given file header into&lt;br /&gt;
results parameters, if given.  The following command will put the size of the&lt;br /&gt;
file SINE1 into a result named FSIZE: &lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; status sine1 fsize&lt;br /&gt;
&lt;br /&gt;
But what if FSIZE contained the name of the result you wanted the file size&lt;br /&gt;
to be stored in?  The sequence &lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; res fsize sizeofsine&lt;br /&gt;
 nM&amp;gt; status sine1 fsize&lt;br /&gt;
&lt;br /&gt;
will still store the size of SINE1 in FSIZE, not in SIZEOFSINE as you wanted.&lt;br /&gt;
The sequence &lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; res fsize sizeofsine&lt;br /&gt;
 nM&amp;gt; status sine1 ^fsize&lt;br /&gt;
&lt;br /&gt;
will do it.&lt;br /&gt;
&lt;br /&gt;
See Also:  EXPLAIN RESULTS, HELP SCOPE&lt;br /&gt;
&lt;br /&gt;
=== VECTORED - THE ONE AND THE MANY&amp;lt;span id=&amp;quot;VECTORED&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
THE ONE AND THE MANY&lt;br /&gt;
&lt;br /&gt;
The NeXtMidas results table can handle scalar, atomic, and array data.  However,&lt;br /&gt;
most large vectors are best stored as files so they can be operated on by&lt;br /&gt;
primitives.  Vectored results are a way to reach into a file to retrieve or &lt;br /&gt;
store values with a result-like syntax.&lt;br /&gt;
&lt;br /&gt;
For a one-dimensional file (type 1000), put the number of the element you&lt;br /&gt;
want to access in parentheses after the file name.  For example, if you&lt;br /&gt;
wanted to print out the eighteenth element of the file R1, you could write &lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; say &amp;quot;The eighteenth element of R1 is ^R1(18).&amp;quot; &lt;br /&gt;
&lt;br /&gt;
and you would get &lt;br /&gt;
&lt;br /&gt;
The eighteenth element of R1 is 17.6331. &lt;br /&gt;
&lt;br /&gt;
Or, if you wanted to assign it to another result: &lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; res temp r1(18)&lt;br /&gt;
 nM&amp;gt; res temp&lt;br /&gt;
 D: TEMP         =     17.633100509644&lt;br /&gt;
&lt;br /&gt;
If the file is two-dimensional (type 2000), then you must give the result&lt;br /&gt;
name two arguments:  frame (&amp;quot;row&amp;quot;), and index (&amp;quot;column&amp;quot;).  To get at the 46th&lt;br /&gt;
element of the 20th frame, write &lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; res temp r1(20;46)&lt;br /&gt;
&lt;br /&gt;
where R1 is a type 2000 file.&lt;br /&gt;
&lt;br /&gt;
If the file is record-oriented (type 3000), two arguments are needed:  the&lt;br /&gt;
record number and either the subrecord name (preceded by a tilde) or the&lt;br /&gt;
subrecord index.  For example, given R1, a type 3000 file whose 5th subrecord&lt;br /&gt;
is named &amp;quot;LOC&amp;quot;, retrieve the value of that subrecord in the 10th record:&lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; res temp r1(10;5)&lt;br /&gt;
&lt;br /&gt;
or, more readably,&lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; res temp r1(10;~LOC)&lt;br /&gt;
&lt;br /&gt;
The individual scalars within a vectored result atom can also be accessed&lt;br /&gt;
directly using an extra ; to specify the scalar of interest.  See HELP&lt;br /&gt;
FEATURES ATOMIC for more.&lt;br /&gt;
&lt;br /&gt;
The contents of the file's header control block (including keywords) is also &lt;br /&gt;
available in a results like syntax as:&lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; say &amp;quot;The size of R1 is ^R1(hcb.sz) elements.&amp;quot; &lt;br /&gt;
&lt;br /&gt;
The HCB.xx syntax supports all of the tags used in STATUS and HEADERMOD for&lt;br /&gt;
positionally independent parameters.  The HCB.KEY.keyname accesses a keyword&lt;br /&gt;
named &amp;quot;keyname&amp;quot; and HCB.SCOPE can be used to scope for the keyword access (if&lt;br /&gt;
the file is an environment file that remains open - see below). &lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; constant outfile template(hcb.f) template(hcb.sz) 0 0 &amp;amp;&lt;br /&gt;
 	template(hcb.xs) template(hcb.xd) template(hcb.xu)&lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; results outfile(hcb.key.comment) template(hcb.key.comment)&lt;br /&gt;
&lt;br /&gt;
creates a file of zeros with the same format, size, abscissa info, and &lt;br /&gt;
comment as the existing Midas file called &amp;quot;template&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are two major advantages to this sort of syntax:&lt;br /&gt;
&lt;br /&gt;
# In addition to retrieval, you can also store directly into an existing&lt;br /&gt;
#: file.  For example, if you wanted to reach into the file DATAPOINTS and&lt;br /&gt;
#: change its fifth element to 0, you can just say &lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; res datapoints(5) 0&lt;br /&gt;
&lt;br /&gt;
# The ability to create a file out of nowhere.  For example, if the file&lt;br /&gt;
#: AVERAGES does not exist, and you say &lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; res averages(1) 5/(6+10)&lt;br /&gt;
&lt;br /&gt;
the file AVERAGES will be created and 0.3125 will be its first element.  You&lt;br /&gt;
can therefore pull vectored results &amp;quot;out of the air&amp;quot; just like any scalar&lt;br /&gt;
result.  This can be really useful in combination with the FORALL command. &lt;br /&gt;
The following command stores the sizes of each file RAMP1 through RAMP20 into&lt;br /&gt;
a result vector named SIZES, which does not yet exist: &lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; forall &amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;=1:20 status/quiet ramp&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; sizes(&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Furthermore, you can deal with this vectored result either as a series of&lt;br /&gt;
results or a file.  After the example above, if you wanted to find out what&lt;br /&gt;
the largest and smallest file sizes were, you could type &lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; maxmin sizes&lt;br /&gt;
&lt;br /&gt;
By default, the format of the created vectored result is SD (Scalar Double).&lt;br /&gt;
If you need a different format, use result-style typecasting, as in:&lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; header/create datapoints	FORM=SB  ! will create a SB-format file&lt;br /&gt;
 nM&amp;gt; res FILE(datapoints).setdata(0) 50 ! will set the first element&lt;br /&gt;
&lt;br /&gt;
Once created, however, the file retains that format and will automatically&lt;br /&gt;
convert new values without use of typecasting:&lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; res FILE(datapoints).setdata(1) 50.6 ! will be stored as 50&lt;br /&gt;
&lt;br /&gt;
VECTORED RESULTS - HELP IS TBD&lt;br /&gt;
&lt;br /&gt;
See also:  EXPLAIN FORALL, EXPLAIN ENVIRONMENT, EXPLAIN AUXILIARY&lt;br /&gt;
&lt;br /&gt;
=== SCOPE - SAYING WHEN&amp;lt;span id=&amp;quot;SCOPE&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
SAYING WHEN&lt;br /&gt;
&lt;br /&gt;
When you prefix a result name with a caret (^), NeXtMidas attempts to&lt;br /&gt;
substitute the entire result name.  This means all continuous alphabetic&lt;br /&gt;
characters, digits, the underscore, and, if followed by an open parenthesis,&lt;br /&gt;
everything up to the closing parenthesis.  However, this is not always what&lt;br /&gt;
is desired.  You can scope the substitution of the result name by the use of&lt;br /&gt;
the curly braces { } .  When you follow the caret with an open curly brace,&lt;br /&gt;
only those characters up to the closing curly brace are considered for&lt;br /&gt;
substitution.&lt;br /&gt;
&lt;br /&gt;
For example, suppose you have a result named FILE which contains some&lt;br /&gt;
filename.  You want to look at the status of the file whose name is the value&lt;br /&gt;
of FILE followed by the number 123 (e.g., if the value of FILE is SINE, you&lt;br /&gt;
want to see the status of SINE123).  So you merrily type &lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; status ^file123 &lt;br /&gt;
&lt;br /&gt;
But what NeXtMidas will do here is look for a result named FILE123.  Not&lt;br /&gt;
finding it, the STATUS command will try to give the status of a file named&lt;br /&gt;
FILE123, which does not exist (in this example, anyway).  What you should say&lt;br /&gt;
is &lt;br /&gt;
&lt;br /&gt;
 nM&amp;gt; status ^{file}123 &lt;br /&gt;
&lt;br /&gt;
This time, the caret only applies to the letters &amp;quot;file&amp;quot;, which is translated&lt;br /&gt;
into (for example) SINE, so that what the STATUS command gets is the name&lt;br /&gt;
SINE123. &lt;br /&gt;
&lt;br /&gt;
Often it is necessary to use scoping within double quotes.  Suppose that you&lt;br /&gt;
have the number of a widget in WNUM.  You want to SAY the value of that&lt;br /&gt;
widget, which you know is referenced by the name &amp;quot;W_&amp;quot; followed by the widget&lt;br /&gt;
number.  There are two ways to do this.  The first way assigns the widget's&lt;br /&gt;
value into a temporary result, then SAYs it:&lt;br /&gt;
&lt;br /&gt;
 res temp W_^wnum&lt;br /&gt;
 say &amp;quot;The frequency width is ^temp.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
But you can do it in a single line with scoping:&lt;br /&gt;
&lt;br /&gt;
 say &amp;quot;The frequency width is ^{W_^wnum}.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note that the following will NOT work:&lt;br /&gt;
&lt;br /&gt;
 say &amp;quot;The frequency width is ^W_^wnum.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
because W_ is being substituted at the same &amp;quot;level&amp;quot; as WNUM.  The scoping&lt;br /&gt;
above makes sure that the entire section within curly braces is substituted&lt;br /&gt;
as a single result AFTER making the substitutions within.&lt;br /&gt;
&lt;br /&gt;
=== FILES - HAVING IT YOUR WAY&amp;lt;span id=&amp;quot;FILES&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
HAVING IT YOUR WAY&lt;br /&gt;
&lt;br /&gt;
In NeXtMidas you can supply an explicit path and extension, if you like.  If you&lt;br /&gt;
supply this path and extension, NeXtMidas will look for that file. Omitting a&lt;br /&gt;
pathname lets NeXtMidas search the aux list, as usual; omitting an extension lets&lt;br /&gt;
NeXtMidas use its defaults of .tmp or .prm . The ability to specify an explicit path&lt;br /&gt;
or extension helps when you want to refer to a file that is not on the standard aux&lt;br /&gt;
list. &lt;br /&gt;
&lt;br /&gt;
BLUE files also contain information as to the data representation of both their&lt;br /&gt;
header and their data.  Because of this, when a library routine reads data from a&lt;br /&gt;
file whose machine data representation is not that of the host machine, it can&lt;br /&gt;
convert it as it is read (or written).  This means that you can, for example, create&lt;br /&gt;
a file on a VAX, transfer it directly to a Sun, and the NeXtMidas on the Sun can use&lt;br /&gt;
the file without any special protocol to make it readable. &lt;br /&gt;
&lt;br /&gt;
There are special auxiliaries: &lt;br /&gt;
&lt;br /&gt;
1.        This aux points to ../data1/+/ (UNIX) where + is replaced with&lt;br /&gt;
 a user name&lt;br /&gt;
11.       This aux points to ../data11/+/ &lt;br /&gt;
12.       This aux points to ../data12/+/ &lt;br /&gt;
99.       This aux points to a special global data directory&lt;br /&gt;
 ($XMAREA/dat on UNIX, XMAREA:[DAT] on VMS).&lt;br /&gt;
CWD:      This aux always points to your current directory, changing as your&lt;br /&gt;
 current directory changes.&lt;br /&gt;
DAT :     This aux points to the SYS option, DAT area.&lt;br /&gt;
HOME:     This aux points to your home directory.&lt;br /&gt;
HOMEPATH: This aux points to your current user macro homepath (see EXPLAIN&lt;br /&gt;
 HOMEPATH), changing as you change your homepath.&lt;br /&gt;
&lt;br /&gt;
Another nice new feature is the ability to use file qualifiers.  &lt;br /&gt;
&lt;br /&gt;
See Also: HELP Qualifiers&lt;br /&gt;
&lt;br /&gt;
=== TRIMMING - JUST A TRIM, PLEASE&amp;lt;span id=&amp;quot;TRIMMING&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
JUST A TRIM, PLEASE&lt;br /&gt;
&lt;br /&gt;
There are many times when you might like to look at just a piece of a file: &lt;br /&gt;
say, the first 300 elements, or the part between 1.5 and 3.5 seconds.  &lt;br /&gt;
&lt;br /&gt;
See User's Guide -&amp;gt; Files -&amp;gt; File Trimmers for more information and examples.&lt;br /&gt;
&lt;br /&gt;
See Also: HELP TRIMMERS&lt;br /&gt;
&lt;br /&gt;
=== METACHARACTERS - There are several characters that have special meaning to the NeXtMidas shell.&amp;lt;span id=&amp;quot;METACHARACTERS&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
There are several characters that have special meaning to the NeXtMidas shell.&lt;br /&gt;
Their function and precedence (from highest to lowest) is given below: &lt;br /&gt;
&lt;br /&gt;
Character   Position	Function				&lt;br /&gt;
 		&lt;br /&gt;
&amp;amp;	     end	Continues command to next line.  In a macro, the line&lt;br /&gt;
 		following will be concatenated without its leading&lt;br /&gt;
 		white space.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;&amp;amp;	     end	No continuation, becomes literal final &amp;amp;&lt;br /&gt;
&lt;br /&gt;
?	     end	Prompts for command arguments.  Does not function &lt;br /&gt;
 		within macros.&lt;br /&gt;
&lt;br /&gt;
$	     start	Forces command to operating system.  Required before &lt;br /&gt;
 		all operating system commands in a macro.&lt;br /&gt;
&lt;br /&gt;
$$	     start	(UNIX) Forces command to be executed in the shell&lt;br /&gt;
 		which is running NeXtMidas (rather than in a subshell).&lt;br /&gt;
&lt;br /&gt;
!	     start	Recall previous command from the shell.&lt;br /&gt;
 Designates command line as comment in a macro.&lt;br /&gt;
&lt;br /&gt;
!	     anywhere	In a macro, designates beginning of inline comment&lt;br /&gt;
 		(except within double quotes).&lt;br /&gt;
&lt;br /&gt;
/	     after&lt;br /&gt;
 command&lt;br /&gt;
 name	Applies following switch to command.&lt;br /&gt;
&lt;br /&gt;
,	     between&lt;br /&gt;
 arguments	Separates arguments.&lt;br /&gt;
&lt;br /&gt;
space	     between&lt;br /&gt;
 arguments	Separates arguments.&lt;br /&gt;
&lt;br /&gt;
^	     before&lt;br /&gt;
 name	Forces the substitution of the result or macro&lt;br /&gt;
 		argument name following.&lt;br /&gt;
&lt;br /&gt;
{}	     after ^	Defines the range of characters to which the &lt;br /&gt;
 		caret (^) applies.&lt;br /&gt;
&lt;br /&gt;
&amp;quot; &amp;quot;	     around&lt;br /&gt;
 argument	Preserves characters bracketed by &amp;quot; &amp;quot; as a literal&lt;br /&gt;
 		STRING argument, leaving their lowercase characters&lt;br /&gt;
 		and white space alone.&lt;br /&gt;
&lt;br /&gt;
%	     before&lt;br /&gt;
 macro name	Designates the macro as a user macro.&lt;br /&gt;
&lt;br /&gt;
underscore&lt;br /&gt;
(_)	     before&lt;br /&gt;
 file name	(the underscore) Designates file name as the name&lt;br /&gt;
 		of a pipe in a piped macro.&lt;br /&gt;
&lt;br /&gt;
()	     after&lt;br /&gt;
 file name	Treats characters bracketed by ( ) as a file name&lt;br /&gt;
 		qualifier; depending on the operators within the&lt;br /&gt;
 		parentheses, may indicate a vectored result, in-line &lt;br /&gt;
 		trimming, or some file attribute to modify.&lt;br /&gt;
&lt;br /&gt;
()	     around&lt;br /&gt;
 expression	Groups expressions in an inline calculation.&lt;br /&gt;
&lt;br /&gt;
[]	   after macro&lt;br /&gt;
 argument	Defines the default for that argument in a user macro.&lt;br /&gt;
&lt;br /&gt;
[]	     within&lt;br /&gt;
 ASK prompt	Defines the default for the ASK prompt.&lt;br /&gt;
&lt;br /&gt;
:	     between&lt;br /&gt;
 type and&lt;br /&gt;
 name	Separates type from macro argument or result label.&lt;br /&gt;
&lt;br /&gt;
:	     in trim&lt;br /&gt;
 qualifier	Separates start from end.&lt;br /&gt;
&lt;br /&gt;
;	   in vectored&lt;br /&gt;
 result name  Separates row and column for Type 2000 files.&lt;br /&gt;
&lt;br /&gt;
=== in - qualifier&amp;lt;span id=&amp;quot;in&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
qualifier&lt;br /&gt;
 or&lt;br /&gt;
 vectored&lt;br /&gt;
 result     Designates following value as abscissa rather than &lt;br /&gt;
 		index.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
[[Category:NXM_Help]]&lt;/div&gt;</summary>
		<author><name>ConvertBot</name></author>
		
	</entry>
</feed>