Previous Next         Current Page: NeXtMidas Training / Macros - Part 1 (Basics) / Lab 1 / Instructions
Start Here   
Background   
Common Midas Concepts   
Getting Started   
Working with Files   
Option Trees   
Macros - Part 1 (Basics)   
   + Macro Basics   
   - Lab 1   
      - Instructions   
      - Solution   
   + Lab 2   
   + Loops and Control Structures   
   + Lab 3   
   + Lab 4*   
   + Procedures and Subroutines   
   + Lab 5   
   + Lab 6*   
   + Pipes in a Macro   
   + Lab 7   
   + Lab 8   
   + Messages in a Macro   
   + Lab 9   
   + Lab 10   
Macros - Part 2 (Graphics)   
Primitives   
Installing NeXtMidas   
Applets & WebStart   
Mapping (NeXtEarth)   
Remote Midas InterFace (RMIF)   
Using NetBeans   
X-Midas Interoperability   
Remoting an X-Midas App.   


  • Lab 1:
    • Using a text editor, create a new file named mcrlab1.mm.
      • Put the file in your home directory.
    • At the top of the macro insert a comment with your name.
    • Now add the appropriate STARTMACRO and ENDMACRO lines.
    • Your macro will take in three parameters:
      NAME A person's name.
      FEET The person's height in feet (no inches).
      INCHES The person's height in inches (less any feet).
    • In the macro compute the persons height in centimeters (cm). You can use the conversion 1cm = 0.3937in. Drop of any fractional centimeters.
    • Use INFO to print out how tall the person is.
    • Try using your macro.
      nM> %mcrlab1 "Lee" 5 6
      INFO: Lee is 167cm tall [%MCRLAB1]