Lesson #2: FLOWCHARTING After you've organized your thoughts on what it is you want the script to do, it's time to begin formalizing things by flowcharting your script. There are standard symbols for flowcharting, but it's not really all that important for you to use them. The standard symbology is important only if: a) it's the easiest thing for you to use and/or b) more than one person will be coding subsections of the script..standardization makes it easier for everyone involved in the project to understand script requirements. Let's take a look at what the beginning of a flowchart might look like for the mailrun script I described in LESSON #1: |-------------------------------------------| | ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ | | ³ Specify Which ³ | | ³ BBS To Call ³ | | ÀÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÙ | | ÚÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄ¿ | | ³ DIAL The BBS ³<ÄÄÄÄÄÄÄÄÄÄÄ¿ | | ÀÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÙ ³ | | ÚÄÄÄÄÄÁÄÄÄÄÄÄ¿ No ³ | | ³ CONNECT? ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÙ | | ÀÄÄÄÄÄÂÄÄÄÄÄÄÙ | |-------------- ³ Yes ----------------------| ÚÄÄÄÄÄÁÄÄÄÄÄÄ¿ ³ LOGON ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ If the script you're working on is going to be fairly complex, you can work on sub-elements a piece at a time..for example, the bounded section above. Narrowing your focus helps to put boundaries on the total job. Once you've narrowed the tasks down into pieces that are easier to handle and once you've made the initial cut at flowcharting a sub-element, you can make additional refinements that enhance the operation of the sub-element. For example, in the chart above: after looking at the program flow, you decide that instead of just going back to the re-dial function after "no connect" you want to do things like: keep track of how many times you've dialed the particular BBS and not go back to re-dial once you get to some predefined # of attempts..you'd rather have the program Exit to Dos at that point rather than continue with the re-dialing. END OF LESSON 2a.. Homework: Revise the flowchart segment to include a check for how many times the script has attempted to dial the bbs, with an "Exit to DOS" if # of dial attempts = upper limit of attempts. Next LESSON: We'll code the bounded area..to include the test for # of dial attempts.. Jim ... OFFLINE 1.52