--- title: "Go with the flow and no illogical jumps" type: "article" slug: "go-with-the-flow-and-no-illogical-jumps" url: "http://localhost/article/go-with-the-flow-and-no-illogical-jumps/" markdown_url: "http://localhost/article/go-with-the-flow-and-no-illogical-jumps.md" published_at: "2020-10-27T17:09:15+00:00" modified_at: "2026-06-21T23:22:41+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "Last month I explained how to draw a flowchart of a program by splitting it into parts. Each part corresponds to an operation performed either by the user or the computer program. This month we take that a step further and examine a way of breaking a program code into easily-understood areas. There are three…" category: - name: "Timex Sinclair User" slug: "timex-sinclair-user" taxonomy: "category" url: "http://localhost/category/periodicals/timex-sinclair-user/" post_tag: - name: "1983" slug: "year-1983" taxonomy: "post_tag" url: "http://localhost/tag/year-1983/" - name: "Full Text" slug: "fulltext" taxonomy: "post_tag" url: "http://localhost/tag/fulltext/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "John Gilbert" slug: "john-gilbert" taxonomy: "indiv" url: "http://localhost/indiv/john-gilbert/" publication: "Timex Sinclair User" publication_r: id: 10278 title: "Timex Sinclair User" type: "periodical" url: "http://localhost/periodical/timex-sinclair-user/" authors: "John Gilbert" volume: "1" issue: "2" issues_articles: - id: 26867 title: "Timex Sinclair User n2" type: "issue" url: "http://localhost/issue/timex-sinclair-user-n2/" pages: "30-31" pubdate: "July 1983" related_articles: - id: 8625 title: "Let the structure flow and you are well on the way" type: "article" url: "http://localhost/article/let-the-structure-flow-and-you-are-well-on-the-way/" archive_link: false volumeissue: "v1n2" --- # Go with the flow and no illogical jumps Last month I explained how to draw a flowchart of a program by splitting it into parts. Each part corresponds to an operation performed either by the user or the computer program. This month we take that a step further and examine a way of breaking a program code into easily-understood areas. There are three main operations performed in a program — input, processing by the computer, and output. Each of those operations has a distinct box in a flowchart and each has a distinct part in a program. If a beginner is to use the program the input section will be the longest, because of error-trapping techniques and instructions. The processing part of the program will be the longest if a technical person, such as a scientist who knows about computers, uses it. Now to deal with methods of prompting a user to enter information into the computer and the best ways in which the computer can handle that information. With programs such as the database, which is to be constructed in this series, the screen display is very important. The computer uses the screen to display information to a user. Many people who use programs such as database or word processors will know nothing about how a computer works or what it expects as input. The more information given to the user by a program the better. That does not mean clogging the screen with vast quantities of text. Instructions on the screen should be easy to read and well-spaced. The clear screen command should be used as often as possible to break-down information into easily-read pieces but at the same time the jump between one screen of instructions and another should be almost transparent to the user. The text must flow naturally and there should be no illogical jumps in the instructions. That is a matter of experience but the database has been designed with clarity of instructions and prompts for inputs in mind. The most important instructions should stand out from the rest. That can be done by liberal use of the GRAPHICS mode. Listing one is the menu subroutine for the database. One thing people tend to forget is that they have the use of all the screen. Do not cram things into the corners or sides of a screen. Titles should be central and if there is only an INPUT prompt on the screen, a good place to put it is the top left-hand corner. Listing one is the first module of the program. If there is a menu in a program it should be situated at the top of the code after any single or array variables have been declared, as in line 100 of listing one. ``` 100 DIM B$(100,20) 300 IF A$="1" THEN GOSUB 2000 400 IF A$="2" THEN GOSUB 3000 500 IF A$="3" THEN GOSUB 4000 600 IF A$="4" THEN GOSUB 5000 700 IF A$="5" THEN GOSUB 6000 800 CLS 900 GOTO 200 1000 CLS 1020 PRINT TAB 12;" MENU " 1030 PRINT AT 5,7;"1 SEARCH FILE ";AT 7,7;"2 DISPLAY FILE ";AT 9,7;"3 LOAD FILE ";AT 11,7;"4 SAVE VILE ";AT 13,7;"5 CREATE FILE " 1035 PRINT AT 18,5;" ENTER OPTION (1-5) " 1040 INPUT A$ 1050 IF A$="" THEN GOTO 1040 1060 RETURN ``` The menu module will display the options available from the program; ask which you require, put the number of the option selected in a string variable A$, and transfer to the control program, also in listing one, at the top of the code. The control program, consisting of a series of IF . . . THEN instructions, will then transfer to the subroutine selected from the menu. The two other modules which are listed in this article are for LOADing data files — listing two — and SAVEing files — listing three. ``` 4000 REM LOAD ROUTINE 4010 CLS 4015 PRINT AT 0,0;"NAME FILE TO BE ENTERED " 4018 INPUT C$ 4030 IF C$=" " THEN GOTO 4010 4040 PAUSE 10 4042 CLS 4045 PRINT AT 0,0;"SET UP TAPE AND PRESS ENTER" 4050 PAUSE 40000 4060 LOAD C$ 4070 PRINT AT 0,0;"FILE LOADED " 4080 PAUSE 100 4090 RETURN ``` The displays in both the SAVE and LOAD routines are important. Error messages should be displayed in the same position on the screen every time they appear. Every program should have a standard error message area to which the user will become accustomed. In the case of the database, that is in the middle of the screen. ``` 5000 REM SAVE ROUTINE 5005 CLS 5010 PRINT AT 0,0;"ENTER FILE NAME " 5012 INPUT C$ 5015 IF C$="" THEN GOTO 5012 5030 PAUSE 10 5032 CLS 5035 PRINT AT 0,0;"SET UP AND PRESS ENTER" 5037 PAUSE 40000 5040 PRINT " FILE """;C$;""" BEING SAVED" 5050 SAVE C$ 5060 PRINT " FILE """;C$;""" SAVED" 5070 PAUSE 100 5080 CLS 5090 RETURN ``` The prompts and information in the SAVE and LOAD routines may seem simple and not worthwhile but the writer knows about the in¬ ternal workings of the program and what to enter. A newcomer to a program, on the other hand, needs to be taken through it step by step. When a module of a program has been written it is a good idea to test it on a friend or relative who knows nothing about computers. If they can follow the prompts, leave the display as it is; if they are confused, you know you have more writing. I have now shown how the database is controlled using the menu and how to ease a user’s task in getting through the program.