Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

return (MathScript RT Module Keyword)

LabVIEW 2010 Help

Edition Date: June 2010

Part Number: 371361G-01

»View Product Info

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.

Details

Examples

Details

If you call this function from a MathScript Node, LabVIEW operates with slower run-time performance for the MathScript Node. To optimize the performance of the MathScript Node, remove this function from scripts.

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