Response to some of your questions

by Artelius (Login Mikrondel)
R

 

> This declaring variables I should be doing, would it look like this?
>
> INPUT "Systolic blood pressure:", Syspress 'This is the systolic pressure
> INPUT "Diastolic blood pressure:", Diapress 'This is the diastolic pressure
> ? "The average systemic blood pressure is:", Diapress+(Syspress-Diapress)*(1/3)

No, what you've done is add some comments to your program. Comments are used to make your program easier for you to read after a few months, or for other programmers to read. They're often used to delineate different sections of the program, explain the reasoning behind the code, and so on.

Solitaire has explained how to declare variables. Among other things, it helps with planning your program, thinking about what you use variables for, and avoiding typos and other mistakes.

>> And about the do-loop, I would like to make the "greeter-menu", the first menu to pop up to return if the user enters a wrong choice. Is this possible if the do-loop ends below the choices? I don't really see how that could work.

The contents of a DO-LOOP will be repeated as long as the conditions hold true. The DO-LOOP in Solitaire's example is unconditional (it will loop forever unless the EXIT DO command is executed).

At the moment, if the user makes an incorrect choice at the first menu, the first menu will reappear (try it!). Also, if the user chooses option 1, the SysAvg procedure will run, and when it finishes, the loop will repeat again (similarly with option 2). So if you make SysAvg end if something incorrect was entered (you can use EXIT SUB for this), the greeter menu will reappear.

Posted on Feb 28, 2010, 1:56 PM

Respond to this message   

Return to Index

 Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement