Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

return (MathScript RT Module Keyword)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info
Download Help (Windows Only)

Owning Class: programming

Requires: MathScript RT Module

Syntax

return

Description

Forces an early return to the caller. The function then stops executing. Functions typically return to the caller when LabVIEW reaches the end of normal execution.

Examples

Details

The following table lists the support characteristics of this function.

Causes reduced performance (warning glyph) Yes
Supported in the LabVIEW Run-Time Engine Yes
Supported on RT targets No

Examples

Save the following script as squareroot.m in the LabVIEW Data directory.

function value = squareroot(x)
% This is a function definition.
     if x<0
          value = 0;
     return
     else
          value = sqrt(x)
     end

After you save squareroot.m, call the following commands in the LabVIEW MathScript Window or the MathScript Node.

squareroot(-8)
squareroot(25)

Related Topics

break
continue
for
while


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit