The Experts below are selected from a list of 6228 Experts worldwide ranked by ideXlab platform

Brent Maxfield - One of the best experts on this subject based on the ideXlab platform.

  • Chapter 12 – Advanced Programming
    Essential PTC Mathcad® Prime® 3.0, 2014
    Co-Authors: Brent Maxfield
    Abstract:

    Looping was the main concept covered in this chapter. This concept, combined with the logical programming discussed in Chapter 9 can make some very powerful programs. There are two types of loops: for loops and while loops. The for loop loops a specific number of times and is controlled by an iteration variable. The while loop will loop until a specific condition is met. If the condition is never met, the loop will go indefinitely. The break and Continue Operators are used to control when and how a program loops. The break Operator stops the execution when a specific condition is met. The Continue Operator allows PTC Mathcad to skip over a portion of a loop and move back to the beginning of the loop. The return Operator is used in conjunction with an if statement. It stops the execution of the program and returns the value following the return Operator. The try-on-error Operator is very useful when a particular operation could cause an error, because you can tell PTC Mathcad what to do when the error occurs.