It is currently Thu Mar 28, 2024 4:40 am


All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Unit 1 - Lesson 7: Editing and Executing Routines
PostPosted: Tue May 24, 2011 3:10 pm 
User avatar

Joined: Wed Nov 17, 2010 8:37 am
Posts: 136
Real Name: Terry L. Wiechmann
Began Programming in MUMPS: 0- 0-1971
The goals of this lesson are to:

  • Use your favorite editor to create and edit routines.
  • Understand and use the DO, GOTO and QUIT commands to execute a routine.

Assignment of Namespaces

In general, namespaces are used to separate groups of routines from each other. It is a common practice for grouping application functionality.

Normally this course is given in a classroom environment where all students store there routines in a common directory or UCI area. Under these conditions it is extremely important to assign namespace prefixes to each student. However, since most of you are distributed you will not have to worry about it unless there are 2 more on one machine in the same area. If you are using a Paideia account, you are running as a separate instance so you do not have to worry about it.

In any event, simply assign yourself a two character prefix to be used in creating routines for this course.

Do the exercises for creating and executing a routine.

DO, GOTO, and QUIT Command

The DO command is the most common command for executing a routine or subroutine within a routine.
Perform the exercise.

What would happen if you replaced the GOTO READ with a DO READ at line READ+6? Go ahead, try it. If you don't understand why, please ask for an explanation on this topic.

Exercise

Notice that the main entry point with the label READ uses a GOTO at the end of it to perform a loop. The purpose of the loop is to iteratively ask for the first and second numbers. Change this subroutine to use the FOR command to set up the iteration loop. If you get it to work, share it with the rest of the students by publishing it on this topic.


This is the last lesson of Unit 1. Proceed to Unit 2 and read ahead. Unit 2 lessons will be published shortly.

_________________
Terry L. Wiechmann


Top
Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net