Diet  -  A dietary analyser

by Andrew Benson

Do not run this application directly from the RISC User disc.

Diet is an application which is very useful for anyone who wants to keep track of what they are eating, and is interested in the nutritional values of the foods they eat. It is valuable not only for those trying to lose weight but also for anyone who wants to maintain a balanced diet.

Diet can be given information about yourself, your sex, age, height, weight, etc and from this will determine the Recommended Daily Amounts (RDAs) of the various nutritional components of your diet.

You can then enter into Diet all the foods that you have eaten in a day and it will calculate what percentage of the RDA for each nutritional component you have had that day. This information can be saved as a text file or can be displayed as a histogram (which can then be saved as a Draw file).

Diet stores a list of all the different food types it knows of, together with their nutritional values. This list can be added to and changed as required. Diet can also calculate the nutritional value of a recipe given the ingredients of the recipe. This recipe can then be stored in the list and used in the same way as any other entry in the list.

Diet supports Acorn's Help application fully.

Using the Application
Running the item from the RISC User menu system will open a directory viewer containing the application !Diet. This should not be run directly from the RISC user disc, but should first be transferred to your hard disc or another floppy, which will de-archive the application in the process. Once transferred, it can be run by double-clicking on its icon in a directory viewer. An icon is installed on the icon bar. Clicking Menu over this icon opens the main menu. Initially three options are available (the others being greyed out). These are Info, Setup and Quit. Info leads to a dialogue box which shows the usual program information, while Quit will cause Diet to terminate.

If you choose the Setup entry a window will appear which allows you to enter your personal details into the program. The options in the window are as follows:
Sex: - Click on whichever is applicable.
Age: - Enter your age in the writable icon.
Height (cm): - Enter your height in centimeters in the writable icon (1 inch = 2.54 cm).
Weight (kg): - Enter your weight in kilograms in the writable icon (1 lb = 0.45 kg).
Build: - Click Select over whichever entry is most applicable.
Activity: - Click Select over whichever entry is most representative of your daily life.

The final options allow you to choose specific diet types. The Weight Gain/Loss option, if selected, allows you to adjust the recommended daily amount of Calories given by the program. If you are intending to gain weight enter the number of extra Calories that you require a day in the writable icon. If you intend to lose weight then enter a negative value in the writable icon equal to the number of Calories that you wish to avoid each day (note that it is not wise to try to cut out too many Calories a day; a doctor can always advise on the best way to lose weight).

The Low Fat option, if selected, will cause the RDA of fat to drop significantly for those who require a low fat diet. To compensate for this the RDA of protein will be increased. It should be noted that the amount of fat quoted as the RDA for the low fat diet (which corresponds to 2% of the daily Calorie intake) is very difficult not to exceed. If you were to have this little fat in your diet then the food you would be eating would be very bland indeed. The best solution with the low fat diet is to try to keep fat to a minimum (and use unsaturated fat if at all possible).

When you have entered all of the above information and are happy with it, click on OK. Diet will calculate your RDAs, which can now be viewed. If you now click Menu over the icon bar icon you will see that all of the options on the menu are now available. Firstly, the Save Setup entry leads to a standard save box which allows you to save a file which contains all the details that you have just entered into the Setup. In future this can then be loaded back into Diet either by double-clicking on the file in a Filer window or by dragging the file to the Diet icon. Your personal information will then be loaded and your RDAs calculated.

Displaying Recommended Daily Amounts
Choosing the RDAs entry from the icon bar menu will open a window which displays the RDAs which have been calculated from your personal information. The window is split into four sections. The first is Nutrition. This contains the RDAs for things such as energy (note that what we normally speak of as a 'Calorie' is in fact one kilocalorie (kcal) and this is how energy is labelled on most foods), carbohydrate, protein, fat and fibre. The next section is Minerals which contains the various elements which are required by the body. The third section, Vitamins, lists the RDAs for the various vitamins. Note that mg stands for milligram, which is one thousandth of a gram, and g stands for microgram, which is one millionth of a gram.

The final section of the RDA window lists your ideal weight range. Note that this is only approximate as different people can have very different ideal weights even though they are the same height and build.

Nutritional Information
Choosing the Nutrition entry from the icon bar menu will display a large window which allows you to add and remove foods from the list that Diet stores. You can also edit existing entries. Click Menu anywhere over this window and you will see a menu which contains different types of food groups; for example Bread, Cereals and Drinks are all present. Each of these entries leads to a submenu which lists all the foods of that type that Diet knows about. One of the entries in the Foods menu will be ticked. This is the current menu category and is where any newly created foods will be stored. To change the current menu category simply click Select on the entry in the menu.

You will see that the window has three sections, Nutrition, Minerals and Vitamins which are similar to those found in the RDA window. These sections tell you how much of each component is provided by the food named at the top of the window. To view the details for a different food simply search through the menu until you find it and then click Select; the information will be presented in the window. To the right of the name of the food is a writable icon labelled Amount. The amount (in grams) of the food is initially set to one typical 'serving' of the food stuff. For example, if you select Bread, Brown from the menu the amount will be 28g, which is the weight of an average slice of bread. You can alter the amount by editing the value in this icon. So for example if you wished to know the nutritional content of 100g of brown bread then you would simply enter 100 in the writable icon and press Return. Diet will calculate the nutritional content of this amount and will then display it in the window.

Using this window it is possible to edit the values of the nutritional components of any of the foods listed in the menu. To do this simply select the food you wish to edit from the menu. Its details will appear in the window as usual. Most often on food packaging the nutritional content of the food is given per 100g. Therefore you should change the amount of the food to 100g (or whatever other value is given) as described above. You can now edit the nutritional details simply by clicking Select over any of the writable icons in the window, deleting the old value and entering your new value. The name of the food can also be edited. Note that values in the Nutrition section should be entered in the units given at the right hand side of the writable icon (i.e. kcal for energy and grams for everything else). Values in the Minerals and Vitamins sections can be entered as either a percentage of the RDA (as this is what is often printed on food packaging) or as actual amounts. The icon labelled % RDA Entry enables you to choose which method of entry you wish to use. When this is selected the entry will be the percentage of the RDA (and the labels above the writable icons will read % RDA). When not selected entry is by the actual amount of the mineral or vitamin (in the units specified next to each nutrient's name), and the labels above each section change to read Amount. Diet will automatically convert any values between a % RDA and an absolute amount whenever you change the style of entry.

Below the Minerals section is another section titled Amount. This section allows you to enter the amount of one standard serving of the food stuff. The amount of one serving is often given on food packaging; in other cases you will simply need to weigh the food. Click Menu over the small menu icon in this section and a short menu is displayed which allows you to enter the kind of unit that the food comes in (e.g. a slice of bread, a packet of crisps, a glass of milk). Simply choose whichever is most suitable.

Once you have entered all of the above information and are satisfied that it is correct, click Select on the OK icon in the bottom right hand corner of the window. The updated information will be stored in Diet's list of foods.

Whenever any changes have been made to the list of foods Diet will save the new information back to disc when you quit the program. If you wish to save it before this (which is always a good idea if you have entered a lot of information since computers do crash sometimes), choose the Save menu option from the main menu.

Adding and Removing Foods
It is possible to add new foods to the list. To do this firstly choose the appropriate current menu category for the new food, as described above. Then click on the Add Food icon in the bottom right hand corner of the window. A new food is created and given the default name of Food, and all nutritional information is set to zero. It is then displayed in the window. You can now edit the name and nutrition data for the new food as described above. It doesn't matter if you can't find the values for all of the entries (many food products will only list those values given in the Nutrition sections so just leave all other values at zero). Diet will automatically separate groups of foods within a menu. For example, in the Basics menu the different types of flour are separated from the other foods by broken lines. This is simply to make the food groups more distinct and easier to find. If you add any new foods then Diet will treat them in this way (by grouping any foods which have the same name before any comma).

To remove a food from the list firstly select the Remove Food icon which can be found above the OK and Add Food icons. Now when you select any entry from the food list it will be removed from the list. If you click Select on one of the items in the Food menu it will be removed along with all the foods contained in that food type. Remember to deselect the Remove Food icon after you have removed all that you wanted to.

Finally, it is possible to add new food type groups to the menu. To do this enter the name of the new group into the writable icon which is to the left of the Add Menu icon. Then click Select on the Add Menu icon. The new food type will be added to the menu and will initially contain one food which you can edit. More foods can be added to the new food type as described above.

Dietary Analysis
Using the above facilities you can build up a menu containing all of the things that you normally eat. With this done you can now analyse the food that you eat each day. To do this choose the Analysis entry from the main menu. A window will appear into which you can enter the food that you have eaten during a particular day.

At the top of the window are three labels: Breakfast, Lunch and Dinner. Below them is a list of all the different nutritional components together with the amount you have eaten for the day and the percentage of your RDA which that accounts for. These will all initially be zero, but are recalculated as soon as you start to enter the foods into the window. The RDAs are displayed as a sum of three figures. The three figures correspond to the RDA provided by Breakfast, Lunch and Dinner respectively so you can see which meals are providing which nutrients.

To enter a food into the window click Menu over the meal to which you wish to add the food (e.g. if you want to add your morning bowl of cornflakes to the window then click Menu over the Breakfast label). A menu will be displayed which contain several options. The first of these is Add food. This entry leads to the same menu used in the Nutrition window. You can therefore use this entry to select any of the foods which you have previously entered into the Nutrition window. Click Select over the food you wish to add and the food's name will appear in the Analysis window together with the amount of the food, which is initially set to one standard serving.

Continue this process to enter into the window all of the foods that you have eaten. It is now possible to alter the amounts of any of the foods that you have entered if you so wish. To do this point to the food that you wish to alter and click Menu. The second entry in the menu will now contain the name of the food which you clicked over. This entry leads to a submenu which contains three entries. The first two allow you to alter the amount of the food. The first entry will be Pieces (or Slices, Glasses etc. depending on the food in question). This leads to a submenu where you can enter the number of units of the food that you ate. Enter the value and press Return. The display in the analysis window will be updated to show the new amount. The second entry in the submenu allows you to enter the amount of the food in grams instead. The final entry in this submenu is Remove and choosing it will cause the food in question to be removed from the window.

Once you have entered all of the foods and adjusted the amounts, the nutritional analysis can be seen in the list at the bottom of the window. This same information can also be presented as a graph - how to achieve this will be described shortly.

The menu contains other entries as well. The Save text entry leads to a standard save box which allows you to save the information in the Analysis window as a text file for inclusion into other documents or for printing. The Save menu entry also leads to a standard save box which you can use to save the information in the Analysis window in a form which can then be reloaded later. Simply double-click on the menu file or drag it to the Diet icon to reload the information which you have saved.

The Recipe entry in the menu is used to create the nutritional information for a new food from its ingredients. To create the new information you must first enter all of the ingredients used in the recipe into one of the meals in the Analysis window. As a very simple example suppose that you wanted to add cheese on toast to the food list. To do this you would add one slice of bread and perhaps 25g of cheese to, say, the Lunch entry on the analysis window as described above. Then click Menu over the meal which you wish to turn into a recipe and select the Recipe entry. A dialogue box will be displayed which allows you to specify other details about the recipe. Firstly you can enter the name of the recipe as it will appear in the food list. In the writable icon labelled Amount made: you should enter the amount in grams that the ingredients you have listed make. In the case of the cheese on toast example this would be about 53g.

The final writable icon in the window allows you to enter how much one serving of the food weighs. In this case it would be the same as the amount made (53g) but for a recipe which makes enough for four, for example, you would enter here the amount served to each person. Clicking Menu over the menu icon in this window will display the short menu which allows you to choose the type of unit. In the case of cheese on toast you would choose Slice. If you are happy with all of this then click on OK. Diet will calculate the nutritional value of the recipe from its ingredients and will then add it as a new food to the food list. From then on it can be used as a normal food entry so that you don't have to enter the whole list of ingredients every time. If you decide that you don't want to make up this recipe after all then click on Cancel to close the recipe dialogue box.

Graphs
The final entry in the main Analysis window is Graph. This leads to a submenu which contains four entries: Nutrition, Minerals, Vitamins and Energy. Selecting any of the first three will cause a window to be opened which displays a histogram of the relevant nutrition data. The histograms show how much of your RDAs you have eaten for each nutrition component in a way that is easy to understand. Each bar is made up of three colours which correspond to the amount of the nutrient provided by each meal.

Selecting the Energy graph displays two pie charts. The one on the left shows you how your intake of energy is made up from carbohydrates, proteins and fats. The pie chart on the right shows the ideal proportions so that you can compare the two.

Clicking Menu anywhere over the graph will display a menu which contains a single entry, Save. This leads to a standard save box which allows you to save the histogram in Draw file format. This can then be loaded into Draw for editing or included in DTP documents etc.

Used correctly Diet can be very useful for those who need to keep a close check on their diet. You might be surprised at how much of certain things you eat each day. The average British diet contains far too little fibre and far too much fat for example.

Copyright  RISC User 1995
