Maple für Professional
Maple für Akademiker
Maple für Studenten
Maple Personal Edition
Maple Player
Maple Player für iPad
MapleSim für Professional
MapleSim für Akademiker
Maple T.A. - Testen & beurteilen
Maple T.A. MAA Placement Test Suite
Möbius - Online-Courseware
Machine Design / Industrial Automation
Luft- und Raumfahrt
Fahrzeugtechnik
Robotics
Energiebranche
System Simulation and Analysis
Model development for HIL
Anlagenmodelle für den Regelungsentwurf
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematikausbildung
Technik
Allgemein- und berufsbildende Schulen
Testen und beurteilen
Studierende
Finanzmodelle
Betriebsforschung
Hochleistungsrechnen
Physik
Live-Webinare
Aufgezeichnete Webinare
Geplante Veranstaltungen
MaplePrimes
Maplesoft-Blog
Maplesoft-Mitgliedschaft
Maple Ambassador Program
MapleCloud
Technische Whitepapers
E-Mail Newsletters
Maple-Bücher
Math Matters
Anwendungs-Center
MapleSim Modell-Galerie
Anwenderberichte
Exploring Engineering Fundamentals
Lehrkonzepte mit Maple
Maplesoft Welcome-Center
Resource-Center für Lehrer
Help-Center für Studierende
_nresults - number of results expected to be returned from a procedure
Calling Sequence
_nresults
Description
Within a procedure, the special name _nresults has as its value the number of variables on the left-hand side of the expression in which the procedure was called. If the procedure call did not involve an assignment, then _nresults is given the value undefined. If the procedure call is nested inside another expression, the value of _nresults is also set to `undefined`. Any time the procedure call on the right-side of an assignment is part of an expression more complicated than a simple function call, _nresults will be set to `undefined`.
Do not use _nresults with option remember or option cache. Only the first result computed is stored in the remember table. Subsequent results with the same input and a different value for _nresults will not respect the current value of _nresults. The Cache package can be used to manually manipulate and simulate a remember table that works with _nresults.
Examples
A procedure to find both the minimum and maximum of an arbitrary sequence of numbers could be written as follows.
maxmin := proc () local max, min, i; max := _passed[1]; min := _passed[1]; for i from 2 to _npassed do if _passed[i] > max then max := _passed[i] elif _passed[i] < min then min := _passed[i] end if end do; if _nresults = 2 then max, min else max end if end proc:
See Also
_passed, parameter, procedure
Download Help Document