home *** CD-ROM | disk | FTP | other *** search
/ Global Amiga Experience / globalamigaexperience.iso / compressed / development / heliosdemodisk3.dms / heliosdemodisk3.adf / Tutorials / Tutorial.doc < prev   
Encoding:
Text File  |  1978-03-31  |  56.7 KB  |  1,323 lines

  1.  
  2.     *************************** TUTORIAL ********************************
  3.  
  4.     This Tutorial is not intended as a substitute for careful reading of
  5.     the detailed program documentation, and merely talks you through a
  6.     few first steps.
  7.  
  8.     Here the aim is simply to accustom you to the HeliOS programming
  9.     environment and mention a few important and useful points which will
  10.     help you to get started.
  11.  
  12.     It is quite impossible to satisfy all requirements in an introduction
  13.     such as this, because HeliOS is aimed at programmers with a wide range
  14.     of expertise: some may be expert programmers and others may never have
  15.     tried programming before.  If you are in either of these categories,
  16.     or if you are coming to HeliOS from another very different language
  17.     like "C" or "Basic", please have patience and give this and the other
  18.     introductory tutorials a chance to explain some of the very unusual
  19.     features which make HeliOS possibly the most interesting and powerful
  20.     programming language for the Amiga.
  21.  
  22.     -------------------------------
  23.     Before you start reading.......
  24.     -------------------------------
  25.  
  26.     Before you commit yourself to reading this tutorial, you would probably
  27.     like to see HeliOS in action, so we have included a range of short demo
  28.     programs.
  29.  
  30.     These programs are very elementary in scope, but will give you some
  31.     useful source code upon which to build your first HeliOS programming
  32.     projects.  The idea is that these programs should provide you with
  33.     a few simple building blocks to help you get started.
  34.  
  35.     The demo source code files are in the HeliOS:Source directory, and
  36.     are easy to run by proceeding as follows:
  37.  
  38.     If you press the "Intpt" button to get into the Interpreter, you will
  39.     find an Interpreter menu item "Compile file" in the "Compiling" menu.
  40.  
  41.     If you use this "Compile file" menu option, you will be presented with
  42.     a file requester using which you can select a source code file to run.
  43.  
  44.     Your selected file will be instantly interpreted, compiled and run.
  45.  
  46.     These source code files can also, of course, be loaded into one of the
  47.     HeliOS editors for inspection and modification, and can also be run
  48.     directly from the editor.
  49.  
  50.     Having seen these demos, please do read this and the other introductory
  51.     documentation before starting to do any HeliOS programming.
  52.  
  53.     ----------------
  54.     HeliOS and Forth
  55.     ----------------
  56.  
  57.     First we should explain that HeliOS is a Forth-like language with many
  58.     functions similar to that language.  Forth may be used as a model to
  59.     get started with HeliOS, but beware of carrying the analogy too far,
  60.     since HeliOS is radically different and more advanced in many respects.
  61.  
  62.     And it is actually easier, too......!
  63.  
  64.     Forth is sometimes (unjustly) thought to be difficult because it uses
  65.     a stack and "reverse polish notation", as does HeliOS, but you will
  66.     soon see that this system is very easy to learn and to use.
  67.  
  68.     In general fig-FORTH has been used as the model for most of the HeliOS
  69.     Forth-like functions, because this version of Forth has become the most
  70.     widely distributed and is more familiar to many people than the later
  71.     versions of the Forth standard.
  72.  
  73.     However, the fact is that there are more HeliOS functions which differ
  74.     from Forth than those which are similar, and the internal organisation
  75.     of HeliOS is totally different from Forth.
  76.  
  77.     If you want to study fig-Forth in one of the readily available texts,
  78.     by all means do so, but with care not to assume too much concurrence
  79.     between the two languages.  You will find a good deal of the general
  80.     program structure of Forth similar to HeliOS, and in particular you
  81.     will find the use of the stack in Forth very similar to HeliOS.
  82.  
  83.     ------------------------------
  84.     The Editor and the Interpreter
  85.     ------------------------------
  86.  
  87.     You are reading this in the HeliOS text editor, which is where
  88.     you spend most of the time when writing software.
  89.  
  90.     When you want to test and run the source code you have written,
  91.     you pass the code over to the Interpreter.
  92.  
  93.     The Interpreter has its own screen, where it handles all matters
  94.     relating to interpretation, debugging, and compiling.
  95.  
  96.     You will have seen already the Interpreter screen, and you can go
  97.     there any time to experiment with typing code at the command lines:
  98.     to do this just press the "Intpt" button.
  99.  
  100.     Note that you can cut and paste between the Interpreter command lines
  101.     and the editors, which can often be useful in testing short sections
  102.     of code.  You can also cut and paste freely between any of the HeliOS
  103.     editors, including the Out editor which "captures" all program output.
  104.  
  105.     To copy code from the editor to the command lines use the editor
  106.     "Copy" function, then move into the Interpreter and use the function
  107.     "Paste command lines" in the Interpreter "Copy/Paste" menu.
  108.  
  109.     To copy code from the Interpreter command lines to the editor use the
  110.     "Copy command lines" in the Interpreter "Copy/Paste" menu, then enter
  111.     the Editor and use "Paste".
  112.  
  113.     You can run code directly from within the editors, as you will see
  114.     later, but when you do so the HeliOS system will automatically move
  115.     you into the Interpreter.
  116.  
  117.     Have a look at the menu options and command buttons in the Editor
  118.     and Interpreter to see the sort of options available and the way
  119.     functional tasks are divided between the two environments.
  120.  
  121.     ------------------
  122.     The HeliOS Editors
  123.     ------------------
  124.  
  125.     Before giving you a short guided tour around the editors, let's
  126.     look at the easy method of getting started with HeliOS so that in
  127.     future you will be able to begin editing with the minimum of effort.
  128.  
  129.     ---------------------
  130.     Setting Startup Paths
  131.     ---------------------
  132.  
  133.     Very often you will be working on the same set of files from session
  134.     to session, or even the same file, so HeliOS allows you to preset the
  135.     paths in each of the editors to any particular files.  Having done so
  136.     you can start HeliOS and get to the file you require with just three
  137.     mouse clicks:
  138.  
  139.     To set the path for any editor, just load the file whose path you wish
  140.     to set, then use the "Save All Paths" option in the "Editing" menu.
  141.  
  142.     HeliOS will remember the path settings for the file requester in each
  143.     editor separately, as well as all other important path settings.
  144.  
  145.     Let us assume that you have this file in Editor1, and you now use the
  146.     "Save All Paths" menu option.
  147.  
  148.     Next time you start Helios, you will be presented initially with the
  149.     Interpreter screen as usual.
  150.  
  151.     To get back to this file:
  152.  
  153.     1.  Press the "Ed 1" button to enter "Editor 1".
  154.  
  155.     2.  Press the "Load File" button.  This is the red and white downward
  156.         pointing triangle button to the right of the filename string.
  157.  
  158.         This will bring up the file requester with the path and name of
  159.         your preset file already set.
  160.  
  161.     3.  Press the "Ok!" button in the file requester.
  162.  
  163.     Your preset file will be loaded without you typing anything and with
  164.     only three mouse clicks required.
  165.  
  166.     If you set each of the editors in this way it can save much time
  167.     compared with the usual method of using the file requester to navigate
  168.     to the same place at the start of every session.
  169.  
  170.     ---------------------
  171.     Using the Help System
  172.     ---------------------
  173.  
  174.     Rather than boring you by explaining the obvious here, you can use
  175.     the built in HeliOS "Help" function to familiarise yourself with the
  176.     general operation of all the buttons and menus.
  177.  
  178.     To enter "Help" mode, either press the "Help" key, press the "Help"
  179.     button, or use the "Help on user interface" menu option.
  180.  
  181.     Now, when you select any button or menu item, you will be presented
  182.     with a short explanatory text.
  183.  
  184.     To get "Help" on normally hidden control panels such as the colour
  185.     requester, the debugger, or the find/replace panel, you merely need
  186.     to activate the required panel before entering "Help" mode.
  187.  
  188.     Use the "Help" mode now to browse through the buttons and menus of
  189.     the HeliOS Editor (and the Interpreter too if you wish).
  190.  
  191.     Notice that some buttons do more than you might initially suppose,
  192.     and some have multi-functions, so look at all the options carefully.
  193.  
  194.     -------------------------------------
  195.     Special use of the Right Mouse Button
  196.     -------------------------------------
  197.  
  198.     In HeliOS the right mouse button is used for many purposes (such as
  199.     screen scrolling), and only acts in the usual Amiga "menu-selection"
  200.     mode when the mouse pointer is positioned over the title bar.
  201.  
  202.     If you have used the "Help" system to look around, you will perhaps
  203.     have noticed that the right mouse button can be used in many places
  204.     to gain quick access to commonly used commands as a "modifier" to
  205.     the left mouse button.
  206.  
  207.     Here are two very useful examples:
  208.  
  209.     1.  Holding down the right mouse button and double clicking the left
  210.         mouse button will put you instantly into columnar block mode.
  211.  
  212.         This is a very useful feature which enables you to cut and past
  213.         columns of text.
  214.  
  215.     2.  Holding down the right mouse button and clicking the left over
  216.         one of the "Ed x" buttons will compile the file in that editor.
  217.  
  218.     You can usually use the SHIFT or CTRL keys instead of the right mouse
  219.     button, but the right mouse method is quicker once you are used to it.
  220.  
  221.     It is worth looking several times through the "Help" system to pick
  222.     up operational details such as this concerning the main controls and
  223.     operations you intend to use often.
  224.  
  225.     ------------
  226.     HeliOS Menus
  227.     ------------
  228.  
  229.     The HeliOS menus all display command key sequences on the right of
  230.     the menu text.
  231.  
  232.     Notice that HeliOS menus allow unrestriced use of ANY command key
  233.     sequences, and also that all menu "Hot-keys" are user configurable,
  234.     along with the menu texts themselves.
  235.  
  236.     It is worth noting and learning the command key sequences for those
  237.     menu commands which you use often.
  238.  
  239.     ------------------------------------
  240.     Reconfiguring menus and command keys
  241.     ------------------------------------
  242.  
  243.     Because the HeliOS editor is easy to reconfigure, you may as well
  244.     learn how to do this as soon as possible so that you can set up the
  245.     software to suit your own preferences.
  246.  
  247.     All editing and menu command keys may be "rebound" in HeliOS, to allow
  248.     you to set up the HeliOS text editor to emulate any other editor to
  249.     which you are already accustomed.
  250.  
  251.     You can rebind single keys using the "Shortcut options" menu, but you
  252.     may prefer to edit the master ASCII key definition file.  This latter
  253.     option allows you to view and change ALL the key commands by editing a
  254.     simple text file.
  255.  
  256.     See the "InitialSetup.doc" file and other main documentation for full
  257.     instructions on how to do this.
  258.  
  259.     In addition you can create and save "Macros" which you can use to make
  260.     your own editing commands.
  261.  
  262.     Again, see the main documentation for details on Macros, but the basic
  263.     idea is that you record a series of commands and attach them to a single
  264.     keystroke.  This is a simple linear recording process very similar to
  265.     that used in many other word processors and text editors.
  266.  
  267.     Because the HeliOS system already uses a very large number of command
  268.     keys, it is important that you take care not to cause conflicting
  269.     allocations.  The process of rebinding keys and setting up macros is
  270.     easy in itself, but you do need to study existing allocations and plan
  271.     your new commands carefully.
  272.  
  273.     ------------------
  274.     Editing menu texts
  275.     ------------------
  276.  
  277.     Once you have changed any command keys you will notice that the menus
  278.     no longer describe the correct command sequences.  This is easy to put
  279.     right because all HeliOS menu texts can be changed by editing an ASCII
  280.     menu text definition file.
  281.  
  282.     In particular, you might wish to edit the "Key Index" menu page to
  283.     reflect any Macros which you have created and to display the commands
  284.     which you personally use most often.
  285.  
  286.     The "MenuText" configuration file is a simple ASCII file which can
  287.     be edited in any text editor and which contains its own instructions.
  288.  
  289.     See the "InitialSetup.doc" file for instructions on how to set up an
  290.     initial startup default "MenuText" file.  Remember that the default
  291.     startup file must be called "HeliOS_MenuText" and must be in the
  292.     same path as the KeyTable file.
  293.  
  294.     The most difficult time using any new software is at the beginning,
  295.     and the sooner you configure everything to suit your own taste, the
  296.     sooner you will be working productively.
  297.  
  298.     ----------------
  299.     The Options Menu
  300.     ----------------
  301.  
  302.     The "Options" menu is a place where you will find many useful settings
  303.     which you will probably want to experiment with early in your use of
  304.     the HeliOS editor.
  305.  
  306.     Here you can do things like setting the scroll speed to suit your own
  307.     Amiga system and choosing colours which you find pleasant.
  308.  
  309.     In particular we recommend that you experiment with the "Return" menu
  310.     options, since these can cause the editor to behave in a manner which
  311.     may be unfamiliar and confusing.  In fact most beginners initially
  312.     dislike the default "AutoIndent Return" setting, which is designed to
  313.     make life easier for programmers writing indented source code.  This
  314.     option behaves by default quite unlike the majority of word processors,
  315.     but can be reset to a more standard mode of operation if required.
  316.  
  317.     Try it both ways now and see what you think, but remember to try the
  318.     AutoIndent setting once you are writing source code since you will
  319.     then find it most useful.
  320.  
  321.     Most experienced programmers will find the default setting excellent
  322.     for editing indented source code but since no other Amiga editor
  323.     provides this facility you may need time to become accustomed to it.
  324.  
  325.     ------------------------
  326.     Saving the "Environment"
  327.     ------------------------
  328.  
  329.     Once you have set everything up to your requirements, do not forget
  330.     to use the "Save Environment" menu option in the "Editing" menu to
  331.     preserve your selected settings.
  332.  
  333.     ----------------------------------------
  334.     The "Status Display" and control buttons
  335.     ----------------------------------------
  336.  
  337.     Most of the status display at the top of the screen is fairly self
  338.     explanatory, but as mentioned above several of the control buttons
  339.     have dual functions.
  340.  
  341.     It is worth examining carefully the "Help" text on all these buttons
  342.     because they control all the most commonly used functions.
  343.  
  344.     In particular, do NOT use the "Editorx" button on the left of the
  345.     file name string gadget until you are very familar with the debugger,
  346.     since this will instantly enter "debug" mode with the current file.
  347.  
  348.     Using the debugger without expertise can be either very confusing
  349.     or downright disastrous, so please take care!
  350.  
  351.     The red and white triangle "Quick Load" button to the right of the
  352.     file name string gadget is very useful and worth remembering.
  353.  
  354.     The red and yellow triangle "Quick Save" button at the far right of
  355.     the editor status bar is very useful because it "lights up" to warn
  356.     you when any text has been changed in the editor.
  357.  
  358.     Pressing the "Quick Save" button when it is highlighted causes the
  359.     text in the editor to be saved with the current file name, and then
  360.     the "Quick Save" button reverts to its neutral colours.
  361.  
  362.     It is very useful to remember that pressing one of the "Ed x" buttons
  363.     with the left mouse button while simultaneously holding down SHIFT or
  364.     CTRL or R-MOUSE will cause the code in that editor to be instantly
  365.     compiled and test-run.  This is one of the most often used shortcuts,
  366.     so it is well worth remembering it from the start.
  367.  
  368.     -------------------------
  369.     Compiling HeliOS programs
  370.     -------------------------
  371.  
  372.     The most common circumstance, certainly while you are learning HeliOS,
  373.     is that you will be wanting to test and compile a program which you are
  374.     writing in one of the editors.
  375.  
  376.     Another common requirement is to test a small section or subroutine
  377.     which is just part of the program you are writing in an editor.
  378.  
  379.     Look at the small fragment of code below, and imagine that you had just
  380.     written it and wanted to test it.
  381.  
  382.     We are going to test this short routine in a moment, but first here are
  383.     four important things to check before trying to run ANY program.  They
  384.     may sound simple and silly, but casually running code without knowing
  385.     what you are doing can be a recipe for disaster.
  386.  
  387.     1. Know what the program is meant to do:
  388.  
  389.        * You should always know what a program SHOULD do before running it.
  390.  
  391.        This little program is intended to allow you to move a small red
  392.        circle around the screen, overwriting any existing screen graphics.
  393.  
  394.     2. Know how to quit the program:
  395.  
  396.        * Always beware of starting up programs which you cannot quit!
  397.  
  398.        You will need to press <Esc> to quit the drawing routine, upon
  399.        which the program will erase the red circles and rebuild the
  400.        HeliOS display.
  401.  
  402.     3. Know how the program is going to affect the HeliOS system:
  403.  
  404.        * Always be aware of what any program is going to do to the main
  405.          HeliOS environment - and save your work if there is any risk.
  406.  
  407.        When running any source code from an editor, HeliOS always moves
  408.        first to the interactive Interpreter display, then interprets the
  409.        source code passed from the editor.  Other than this, our little
  410.        program will not affect the main system.
  411.  
  412.     4. Know what system resources the program is going to change:
  413.  
  414.        * Always be aware of what any program is going to do to any part
  415.          of the Amiga's memory and operating sytem.
  416.  
  417.        Since the small "red circle" program uses the HeliOS default
  418.        graphic output, the program will only write to the HeliOS main
  419.        display area.  After this it will clear the HeliOS display.
  420.  
  421.  
  422.     Now you know what to expect, and you know how to get back to HeliOS by
  423.     pressing <Esc>, it is safe to try the program.
  424.  
  425.     Because it is just a short routine, you can run it by highlighting
  426.     the block of text and pressing <Left-Amiga-e>.  Alternatively you
  427.     could use the "Cut/Paste" menu option named "Compile marked block".
  428.  
  429.     Double click the left mouse button with the pointer on the blank line
  430.     immediately before the line containing the words "Clear the dictionary".
  431.  
  432.     This will start the highlighted area.
  433.  
  434.     Note that in HeliOS block highlight operations are defined entirely by
  435.     the reverse video display zone.
  436.  
  437.     This means that in HeliOS the highlighted area DOES NOT INCLUDE THE
  438.     CURSOR, so the single character under the cursor will NOT be included
  439.     in your highlighted block.
  440.  
  441.     Drag the mouse to past the program so that the highlighted area ends
  442.     on the blank line just after the line containing "Run new program".
  443.  
  444.     Hold down the Left Amiga key and press the "e" key.
  445.  
  446.     Try out the program, and remember to press the <Esc> key to quit.
  447.  
  448.     Highlight from the NEXT line below this one.
  449.  
  450.  
  451.     FORGET **CORE**                     \ Clear the dictionary
  452.  
  453.     : TUTORIAL1                         \ New program name
  454.  
  455.     FWINDOW -1 POINTER                  \ Switch off mouse pointer
  456.     1 REPORTMOUSE                       \ Switch on mouse position reports
  457.     1 GFXOUTLINE                        \ Enable graphic "outline" mode
  458.     1 GFXSETOPEN                        \ Set graphic outline pen to black
  459.     6 GFXSETAPEN                        \ Set foreground drawing pen to red
  460.  
  461.     BEGIN                               \ Start loop
  462.       GFXWAITTOF                        \ Wait for new frame
  463.       MOUSEX MOUSEY 8 4 GFXAREAELLIPSE  \ Draw red circle with black outline
  464.       GFXAREAEND                        \ Write area drawn to screen
  465.       ?TERMINAL 27 =                    \ Wait for <Esc>
  466.     UNTIL
  467.  
  468.     0 REPORTMOUSE                       \ Switch off mouse position reports
  469.     0 GFXOUTLINE                        \ Disable graphic "outline" mode
  470.  
  471.     FWINDOW 0 POINTER                   \ Switch on mouse pointer
  472.     SCRCLR                              \ Clear HeliOS text display
  473.     FSTATUS                             \ Redraw HeliOS display imagery
  474.     ;
  475.  
  476.     TUTORIAL1                           \ Run new program
  477.  
  478.     Remember: highlight to the line ABOVE this one, let go of the mouse
  479.     button, and then hold down the L-Amiga key while pressing the "e" key.
  480.  
  481.     Look at the comments in this little program and try changing a few
  482.     things.
  483.  
  484.     For example, try changing the following lines:
  485.  
  486.     6 GFXSETAPEN                        \ Set foreground drawing pen to red
  487.     ^
  488.     Change this number to alter the colour of the drawing circle.
  489.  
  490.       MOUSEX MOUSEY 8 4 GFXAREAELLIPSE  \ Draw red circle with black outline
  491.                     ^ ^
  492.                     Change these numbers to alter the circle/ellipse size.
  493.  
  494.     Recompile this small section of code a few times with different values,
  495.     just to see how things work.
  496.  
  497.     Running this little program illustrates how simple it is to test a
  498.     section of code from within the HeliOS editors.
  499.  
  500.     Notice that you are always placed in the interpreter when HelIOS is
  501.     running any code, and you need to press the "Ed x" button to get back
  502.     here to the editor.
  503.  
  504.     You may be interested at this point to know what happens if there is
  505.     an error when you are compiling either part or the whole of the source
  506.     code in any editor.
  507.  
  508.     If there is a mistake in your code, the line of text with the mistake
  509.     is displayed in the interpreter window, and a set of small arrows will
  510.     point to the error in the code line.
  511.  
  512.     Subsequently, when you return to the editor, you will automatically
  513.     be taken to the error line.
  514.  
  515.     Try compiling the line below now, by highlighting it, just as you did
  516.     the earlier code, and pressing "L-Amiga+e":
  517.  
  518.     By the way, make sure that the highlighted area starts BEFORE and goes
  519.     PAST the ends of the line: if you miss off the last ";" character the
  520.     compilation will fail.
  521.  
  522.     : MISTAKE SCRCLR 2 2 CURPUT ." Hi" 2 4 CURPUUT ." There!" WAITSPACE ;
  523.  
  524.     You can see that the mistyping of CURPUUT has been picked up by the
  525.     HeliOS interpreter, and note that wherever you may have been in the
  526.     editor you are always be brought back immediately to the error position.
  527.  
  528.     Now try highlighting the code line again and this time use the "Copy
  529.     block" function in the Cut/Paste menu to make a copy of the text.
  530.  
  531.     Now go into the interpreter and use the interpreter Cut/Paste menu
  532.     function to "Past command lines", so that the code line appears in
  533.     the interpreter command lines.
  534.  
  535.     Hit <Return> in the interpreter and you will, of course, find that the
  536.     code fails again.
  537.  
  538.     Press the "Cursor up arrow" key to retrieve the previous command line
  539.     and edit the faulty CURPUUT to the correct version: CURPUT.
  540.  
  541.     Now run the code again from the interpreter command lines.
  542.  
  543.     This time you should get an OK message.
  544.  
  545.     Notice that you keep getting a message telling you that MISTAKE has
  546.     multiple definitions.
  547.  
  548.     This is because MISTAKE does have multiple definitions - you guessed!
  549.  
  550.     Each time you try out a new version of a word, the old one remains in
  551.     the HeliOS dictionary, which can be useful - but we will not try to
  552.     explain this until you are a little more expert!
  553.  
  554.     If you keep recompiling small words like this, you keep consuming
  555.     tiny amounts of HeliOS dictionary space as each new definition is
  556.     compiled IN ADDITION TO the old ones.
  557.  
  558.     The "Dict" display in the top left corner of the Status Display always
  559.     shows you how much HeliOS dictionary space is available.
  560.  
  561.     Try compiling a few more versions of MISTAKE by pressing the "up arrow"
  562.     key, followed by <Return>, and as you do this observe how the "Dict"
  563.     display shows a reduced available Dictionary space.
  564.  
  565.     It really is a little untidy to keep making multiple copies of every
  566.     function as you experiment at the command line to improve your code,
  567.     so you will probably want to know how to remedy this.
  568.  
  569.     To clear definitions from the HeliOS dictionary you say FORGET followed
  570.     by the name of the word you want to forget.
  571.  
  572.     For example:
  573.  
  574.     FORGET MISTAKE
  575.  
  576.     would "forget" the latest copy of MISTAKE.
  577.  
  578.     There is one important thing to know about FORGET, and that is that it
  579.     forgets EVERY word compiled SINCE the target word as well as the target
  580.     word itself - so take care.
  581.  
  582.     Try compiling MISTAKE ten times, watching the dictionary free space
  583.     display go down.
  584.  
  585.     Now use FORGET MISTAKE ten times and watch the dictionary free space
  586.     go back up again.
  587.  
  588.     Usually, in fact, we want to clear all user words to give us a "clean"
  589.     system, and in this case you use the expression FORGET **CORE**.
  590.  
  591.     Try using FORGET **CORE** now to clear the system down to the CORE
  592.     vocabulary.
  593.  
  594.     In general you need not use FORGET after every recompilation from the
  595.     command lines, and the occasional use of FORGET **CORE** is all that
  596.     is required to keep the dictionary clear.
  597.  
  598.     Never worry about the messages concerning "multiple definitions" since
  599.     this is only a warning and there are no serious detrimental effects.
  600.  
  601.     When you are compiling programs from an editor, it is best to put the
  602.     line FORGET **CORE** at the start of all your programs.  If you do this
  603.     the system will always be cleared each time you recompile.
  604.  
  605.     Notice that the first line of our "Red Circle" program was:
  606.  
  607.     FORGET **CORE**                     \ Clear the dictionary
  608.  
  609.     Now, finally, go back to the interpeter and recompile the correct
  610.     version of MISTAKE.
  611.  
  612.     The interpeter said OK, but nothing happened otherwise.
  613.  
  614.     You simply compiled the word MISTAKE, which effectively now is a new
  615.     word within the HeliOS vocabulary.
  616.  
  617.     Use the menu option to list the vocabulary and you will see that you
  618.     have indeed created a new command called MISTAKE.
  619.  
  620.     You have not yet, however, run the small program contained in the
  621.     definition of MISTAKE.
  622.  
  623.     To run MISTAKE, you now only need type MISTAKE in the command lines
  624.     and press <Return>.
  625.  
  626.     Try it now.
  627.  
  628.     All that you have done above will illustrate to you the simple way
  629.     that HeliOS works by adding new commands to the language.  In fact,
  630.     HeliOS programming consists always in this process of extending the
  631.     language.
  632.  
  633.     As you may imagine, it is not long before you start to build up a
  634.     new repertoire of commands which YOU have created.  The advantage
  635.     of HeliOS programming is that all these new commands which you create
  636.     have three absolutely wonderful characteristics:
  637.  
  638.     1.  You wrote them yourself to do a job which you required, so you
  639.         have built a new tool which is very useful to you for ever more.
  640.  
  641.     2.  Because you wrote them yourself, you understand them thoroughly.
  642.  
  643.     3.  You will have given them NAMES which YOU find appropriate, so you
  644.         will find them easy to remember and your code will be very readable
  645.         to you since it uses your own function names.
  646.  
  647.     Think about it for a moment, and you will see that programming in
  648.     HeliOS is like building your very own language, so how could it not be
  649.     absolutely ideal for your own purposes!
  650.  
  651.     After a while you will have built a HeliOS system "in your own image"
  652.     and you will be able to do far more with it than if you were confined
  653.     to the straight-jacket of someone else's strict programming system.
  654.  
  655.     You can even simply change HeliOS word names which you do not like.
  656.  
  657.     Let us suppose that you can never remember a certain word name, for
  658.     example "WBENCHTOFRONT".  Let us suppose that you are really sick of
  659.     mistyping this stupid long word, and you want to change its name to
  660.     "WBF".
  661.  
  662.     All you need do is use the following line:
  663.  
  664.     : WBF WBENCHTOFRONT ;
  665.  
  666.     You will now have redefined a new name for WBENCHTOFRONT.
  667.  
  668.     Try it, and try typing WBF.
  669.  
  670.     Look in the vocabulary and there you have it: WBF!
  671.  
  672.     So you can appreciate that once you have moulded HeliOS to fit your own
  673.     ideas and mode of expression, it will be a powerful and personal tool.
  674.  
  675.  
  676.     --------------------------
  677.     Status and debug reporting
  678.     --------------------------
  679.  
  680.     Notice that when a program finishes the HeliOS system reports the
  681.     state of the stack etc. into the main window.  In fact you normally
  682.     get full information about program execution time and how long the
  683.     program took to execute, as well as a stack readout.  This information
  684.     can be switched off, but it is normally quite useful to retain it.
  685.  
  686.     How many other languages give you this information automatically?
  687.  
  688.     In fact, the reason that the HeliOS display switches to the Interpreter
  689.     screen while running a program is so that you can view any text messages
  690.     output while the program is running and when it completes.
  691.  
  692.     By default all such text messages go to the main Interpreter screen.
  693.  
  694.     One of the most commonly used, and best, debugging methods is to make
  695.     your program output debug messages while it is running.  Simple text
  696.     messages and stack reports can tell you where your program is going
  697.     wrong, and often this will be all you need to debug even complex
  698.     programs.
  699.  
  700.     Of course, it can be very annoying if messages output by a program
  701.     scroll off the screen before you can read them!  Everyone has suffered
  702.     this at one time or another, and if your program is outputting debug
  703.     messages to the HeliOS screen while running a different display you
  704.     might never even SEE the messages of course.
  705.  
  706.     Some systems get around this problem by using a second computer and
  707.     a serial port link as a "debug console", but this is hardly convenient
  708.     for all circumstances.
  709.  
  710.     HeliOS has a very nice way of getting around the problem, and it does
  711.     so by using an editable output review buffer.
  712.  
  713.     By default (although this option is switchable) all text output to the
  714.     main Interpreter window also is output into one of the Editors.  This
  715.     "Output Buffer" editor is called simply the "Out" editor, and is exactly
  716.     the same as the other three editors except that it receives a full copy
  717.     of the Output text stream from the Interpreter.
  718.  
  719.     You can see the "Out" button at the top of the screen, and you will
  720.     notice that it has a small red "highlight".  This highlight indicates
  721.     that the option for Interpreter output to be preserved in the "Out"
  722.     editor is currently "On".
  723.  
  724.     You can switch off this feature from the Interpreter menus if you wish,
  725.     upon which the highlight will be switched off and the "Out" editor can
  726.     be used as a normal editor.
  727.  
  728.     Not only can you switch off this feature and use the "Out" editor as a
  729.     normal editor; you can also:
  730.  
  731.     * Set the size of the output buffer,
  732.     * Clear the output buffer,
  733.     * Switch on/off session log markers which identify each output
  734.     * Switch on/off separator lines between outputs
  735.  
  736.     These latter two options allow you to divide up the output text into
  737.     sections which you can easily relate to individual output sessions.
  738.     Even program execution times and stack returns are recorded, so that
  739.     the "Out" editor becomes a full session log and debug report facility.
  740.  
  741.     Since you can freely edit, print, save, cut and paste the "Out" editor,
  742.     you can use it to do many useful things, such as generating programmed
  743.     text tables etc. This is a another very powerful unique HeliOS feature.
  744.  
  745.     Above all though, it is useful to be able to retain debug and error
  746.     reports, and we recommend that you leave this feature enabled unless
  747.     you really need to use four editors simultaneously.
  748.  
  749.     Look in the "Out" editor now and you will see the full report of your
  750.     earlier sessions, recorded even complete with the time you did things.
  751.  
  752.     ------------------------------
  753.     Running complete program files
  754.     ------------------------------
  755.  
  756.     Running a program which consists of a complete text file is actually
  757.     even easier than running a highlighted subsection of code.
  758.  
  759.     All you need to do is load the program file into an editor, for example
  760.     "Ed 1", then press the "Ed 1" button at the top of the screen while
  761.     holding down the right mouse button (or the CTRL or SHIFT key).
  762.  
  763.     The HeliOS system will once again switch to the Interpreter screen and
  764.     run the program.
  765.  
  766.     If you look in the Key Index menu you will see that there is a command
  767.     key for compiling the current editor: this is CTRL+"5".
  768.  
  769.     -----------------------------
  770.     Experimenting at the keyboard
  771.     -----------------------------
  772.  
  773.     HeliOS is an easy language to learn at the keyboard and there is no
  774.     real substitute for creative experimentation. Once you have discovered
  775.     how simple it is to open screens and windows, and to output graphics
  776.     and text within an easily comprehensible system, your efforts can soon
  777.     be directed to really creative programming.
  778.  
  779.     The source code files supplied with HeliOS have been included to give
  780.     you a starting point for your own efforts.  All you have to do is load
  781.     up any of the supplied source code and take from it the sections which
  782.     interest you.
  783.  
  784.     You can very easily elaborate on these simple demonstration programs,
  785.     and at the same time have all the basic support routines already strung
  786.     together for you.  This saves you the tedium of looking up new words at
  787.     every turn when you are still learning.
  788.  
  789.     HeliOS code can be entered on the lines at the bottom of the Interpreter
  790.     screen and then, by pressing return, transmitted directly to the HeliOS
  791.     interpreter. The up and down cursor keys can be used to recover previous
  792.     input for modification and retrial if required, which makes the system
  793.     very comfortable for quick keyboard experimentation.
  794.  
  795.     For longer and more advanced sections of HeliOS code you can perhaps
  796.     more easily experiment by entering your code in an editor and compiling
  797.     it from there, either as a complete file or a marked block.
  798.  
  799.     Remember always to save your code to disk before compiling it, just in
  800.     case the program crashes.
  801.  
  802.     The format of your code is quite unrestricted, and it really is a matter
  803.     of personal taste how you wish to lay things out.
  804.  
  805.     Notice that source code comments can be entered in several ways. Long
  806.     sections of commentary can be entered using the word "(" as follows:
  807.  
  808.     ( ................ Commentary ........................................
  809.      ................................... Commentary...................... )
  810.  
  811.     The interpreter will skip all the material between the two round brackets.
  812.  
  813.     Remember that the first round bracket must, like all HeliOS words, have
  814.     a space before it and a space after it. The second round bracket still
  815.     needs a preceding and succeeding space, even though it is merely a
  816.     delimiter.
  817.  
  818.     There is also provision for skipping commentary material up to the end of
  819.     each line by using the word "\" as follows:
  820.  
  821.     HELIOSWORD ..... HELIOSWORD  \ This is a comment and will be skipped.
  822.  
  823.     The interpreter will skip the material after "\", up to the end of the
  824.     line, and then restart interpretation at the beginning of the next line.
  825.  
  826.  
  827.     ----------------
  828.     PAUSE convention
  829.     ----------------
  830.  
  831.     In HeliOS a convention has been adopted when dealing with continous
  832.     scrolling displays which it may be useful to know from the start.
  833.  
  834.     It is very frustrating when scrolling displays go scrolling off the
  835.     screen before you can read them.  If you try to examine the HeliOS
  836.     CORE vocabulary for example, you will find that it rapidly scrolls
  837.     through many screens of text.
  838.  
  839.     Any operation which may require to be paused, such as listing the
  840.     vocabulary to the screen, or DUMPing memory contents, will always in
  841.     HeliOS include a standard PAUSE function.
  842.  
  843.     This PAUSE function works as follows :
  844.  
  845.     <SPACE> = Pauses operation.
  846.     <SPACE> = Restarts after Pause.
  847.     <ESC>   = Quits operation, and can be used while paused or not.
  848.  
  849.  
  850.     -----------------------------
  851.     Requester response convention
  852.     -----------------------------
  853.  
  854.     Another convention is that when a HeliOS requester appears at the top
  855.     of the display requiring a "positive" or "negative" response, such
  856.     as a "Proceed/Cancel" request, it may be answered from the keyboard
  857.     using the "y" and "n" keys.
  858.  
  859.     "y" = Positive respose (Yes)
  860.     "n" = Negative respose (No)
  861.  
  862.  
  863.     -------------------------
  864.     Text, Windows and Streams
  865.     -------------------------
  866.  
  867.     HeliOS uses an interesting and powerful text stream system which can
  868.     save you a great deal of programming effort.
  869.  
  870.     It is worth mentioning this here to introduce you to what is a quite
  871.     unfamiliar concept on the Amiga.
  872.  
  873.     All normal output passes via the standard HeliOS text output routines
  874.     which use an enhanced application of the Amiga console device and
  875.     transmit screen output via a system of ten HeliOS text streams.
  876.  
  877.     You can set up a comprehensive HeliOS console text output system for
  878.     any window by simply using the one word MAKEOUTWINDOW, and in a similar
  879.     way you can set up a sophisticated user input gathering system by using
  880.     MAKEINWINDOW.
  881.  
  882.     These two single word functions are equivalent to many pages of rather
  883.     complex code in many other languages.  If you are a "C" programmer, try
  884.     considering how much code you would need to write to achieve the full
  885.     functionality of the HeliOS STREAM system we are about to describe.
  886.  
  887.     HeliOS is full of such labour saving devices, which is why it can be
  888.     considered an ideal beginner's language as well as being probably the
  889.     most powerful language on the Amiga.  You CAN have the best of both
  890.     worlds, and power is not always synonymous with tedious complexity.
  891.  
  892.     HeliOS console text output is always associated with one of the ten
  893.     streams, and the current stream can be set by using the single word
  894.     STREAM, preceded by a number from 0 to 9.
  895.  
  896.     Before we even start to explain streams, try the little program below
  897.     which outputs the HeliOS vocabulary list to a small text window: if
  898.     you do not wish to wait for the whole listing to scroll by just press
  899.     <Esc> to quit.
  900.  
  901.     6 STREAM 20 10 20 10 SCRWIN 1 BPENSET 6 FPENSET VLIST 2 STREAM SCRCLR
  902.  
  903.     or, with better layout and comments:
  904.  
  905.     6 STREAM               \ Enter stream 6
  906.     20 10 20 10 SCRWIN     \ Set stream 6 text window
  907.                            \ Top corner = Column 20 Row 10
  908.                            \ Width      = 20 Columns
  909.                            \ Height     = 10 Rows
  910.     1 BPENSET              \ Set background pen to 1 (=Black)
  911.     6 FPENSET              \ Set foreground pen to 6 (=Red)
  912.     VLIST                  \ Output any demo text (list the vocabulary)
  913.     2 STREAM               \ Return to interpreter output window stream
  914.     SCRCLR                 \ Clear the mess we have made!
  915.  
  916.  
  917.     This creates a new text window as STREAM 6, outputs text to it, then
  918.     returns to STREAM 2 and clears the interpeter (STREAM 2) display.
  919.  
  920.     You now have STREAM 6 set up in terms of colours, window size, and
  921.     position, so you can try something like:
  922.  
  923.     6 STREAM SCRCLR ." Hello!" WAITSPACE 2 STREAM SCRCLR
  924.  
  925.     Try it.
  926.  
  927.     It really is that easy to set up text streams!  No other language
  928.     has anything like this facility, so once again HeliOS gives you
  929.     a labour saving edge over other Amiga languages.
  930.  
  931.     Try highlighting and running the short program below, from the line
  932.     after this one to the line after the word STREAMTEST.
  933.  
  934.     : STREAMTEST
  935.  
  936.     2 STREAM  SCRCLR
  937.     6 STREAM 20  8 20 10 SCRWIN 1 BPENSET 6 FPENSET
  938.     7 STREAM 45 12 20 10 SCRWIN 7 BPENSET 1 FPENSET
  939.     8 STREAM 70 16  5 10  SCRWIN 3 BPENSET 4 FPENSET
  940.     100 0
  941.     DO
  942.       6 STREAM ." Hello There!"
  943.       7 STREAM ." Hello There!"
  944.       8 STREAM ." Hello There!"
  945.     LOOP
  946.     2 STREAM
  947.     4 20 CURPUT ." Press <Space> or <L-Mouse> to continue."
  948.     WAITSPACE
  949.     SCRCLR
  950.     ;
  951.  
  952.     STREAMTEST
  953.  
  954.  
  955.     Highlight to the line above this one.
  956.  
  957.     As you can see, text output via HeliOS streams is simple to program
  958.     and very powerful.
  959.  
  960.     Here is a very brief overview of streams:
  961.  
  962.     Having set a stream, you can set up a text window, with unique text
  963.     styles and colours, and that stream will retain these settings.  You
  964.     can set up several streams and move between them using the STREAM
  965.     command, instantly recalling the preset stream characteristics of each
  966.     stream.
  967.  
  968.     These text windows are actually subsections of a console text display
  969.     and are not in any way related conceptually to Intuition windows.  An
  970.     Intuition window is the background entity to which a console text
  971.     output display may be connected, but the HeliOS stream window is merely
  972.     a further subdivision of the console text display area.
  973.  
  974.     Any text formatting carried out while using any particular stream is
  975.     automatically remembered when the stream is left, and restored when
  976.     that stream is re-entered.
  977.  
  978.     Output in any stream can be formatted using a word called SCRWIN to
  979.     set up a restricted independent "scrolling text window" area of the
  980.     screen into which output is channelled.  You can use SCRCLR to clear
  981.     any stream window.
  982.  
  983.     Setting a new stream text window causes the cursor position to be forced
  984.     to the top left corner of the window.  All output is then confined within
  985.     the text window limits and automatic scrolling takes place.
  986.  
  987.     There is also a word SETCONORIGIN which allows precise pixel-placement
  988.     of text stream window boundaries.  You can have several stream windows
  989.     within a single "console device" window, each with a different pixel
  990.     alignment with respect to each other and the main "parent" window.
  991.  
  992.     A wide range of text styles and colours can be set by the user and will
  993.     be automatically associated with the current STREAM and remembered.
  994.  
  995.     In general, the idea of STREAMS is that many features of a text window
  996.     are associated with the current stream, and are automatically preserved
  997.     as you move from one stream to another.  This enables you to completely
  998.     define many different output formats and change between them instantly
  999.     merely by use of the single word STREAM.
  1000.  
  1001.     ------------------------------------------
  1002.     A few interesting features of text streams
  1003.     ------------------------------------------
  1004.  
  1005.     The HeliOS display uses some streams itself, and in cases where your
  1006.     program uses streams it is best to call a function named INITFSTREAMS
  1007.     when your program finishes, to reinitialise the HeliOS stream system.
  1008.  
  1009.     Rows and columns within text windows in HeliOS are numbered from 1
  1010.     upwards i.e. the top left corner is 1,1.
  1011.  
  1012.     Text stream output can be simultaneously directed, using PRTON/PRTOFF,
  1013.     to a printer via the AmigaDOS PRT: device.
  1014.  
  1015.     Text stream output can also be sent to any "capture" file if the file
  1016.     handle is placed in the variable ALTOUT.
  1017.  
  1018.     See FILEON, FILEOFF, OPENALT, CLOSEALT, and ALTERNATE in the Dictionary.
  1019.  
  1020.     There are many commands related to HeliOS text output, and in particular
  1021.     things like cursor control and automatic collection of user input are
  1022.     well worth investigating early in your HeliOS programming efforts.
  1023.  
  1024.     Please read the dictionary file to get more details about console
  1025.     output/input and general text handling.
  1026.  
  1027.     You will find that HeliOS has no rival on the Amiga in terms of its
  1028.     text handling ability, and also has the most comprehensive array of
  1029.     text string handling words.
  1030.  
  1031.     We hope that you are already happy that HeliOS has been an excellent
  1032.     investment for you, in terms of the care and attention which has gone
  1033.     into making this a truly excellent Amiga programming system.  If you
  1034.     like the small things you have seen so far, just think that you have
  1035.     over 1000 special HeliOS functions at your disposal, and probably the
  1036.     most advanced arcade game programming subsystem available on any home
  1037.     computer.
  1038.  
  1039.     Let us look at some more unique HeliOS features which distinguish it
  1040.     from all other programming languages.
  1041.  
  1042.  
  1043.     -----------------
  1044.     Resource tracking
  1045.     -----------------
  1046.  
  1047.     On a flexible and multi-tasking computer such as the Amiga, many of
  1048.     your programming tasks relate to the requesting of available resources
  1049.     from the operating system, and the restoring of these resource when you
  1050.     have finished with them.
  1051.  
  1052.     If you are just learning to program the Amiga, you may find that good
  1053.     intentions in this direction sometimes fail, and you will not always
  1054.     succeed in closing down a faulty program, for example, with all its
  1055.     resources restored to the Amiga operating system.  You may end up with
  1056.     memory allocated by a program and not restored correctly, windows not
  1057.     closed, and all manner of other discrepancies.
  1058.  
  1059.     HeliOS can help you if this happens, because unlike any other Amiga
  1060.     language it has a comprehensive built in resource management system.
  1061.     HeliOS maintains internal lists detailing everything that has been
  1062.     allocated and opened using HeliOS commands.  If you close down Helios,
  1063.     the HeliOS system will automatically do a comprehensive clean up of any
  1064.     allocations which you may have missed, restoring the Amiga operating
  1065.     system to what it was when HeliOS started up.
  1066.  
  1067.     If you find that your early efforts have messed things up a little, all
  1068.     you need do is close down HeliOS and then start again.  HeliOS will
  1069.     clear everything up for you (unless you did serious damage!) and you
  1070.     can start again without rebooting.
  1071.  
  1072.     You could actually use this comprehensive resource tracking system to
  1073.     be totally lazy, allowing HeliOS to do all your clearing up for you,
  1074.     but this is, needless to say, not a good idea.  Nevertheless, if you
  1075.     are writing some experimental code which you want to test quickly, and
  1076.     you haven't time to write all the close down routines properly, you can
  1077.     at least use the HeliOS resource manager as a temporary aid.
  1078.  
  1079.  
  1080.     ----------------------
  1081.     Command line "History"
  1082.     ----------------------
  1083.  
  1084.     The Intepreter command lines have a "History" feature which allows you
  1085.     to recall previous input for modification.
  1086.  
  1087.     The good news is that actually this is a feature of the HeliOS built-in
  1088.     line editor, and so it is available for use in all your own programs.
  1089.  
  1090.     The command line editor will not duplicate remembered input sessions,
  1091.     so if you make the same input five times, only one will be remembered.
  1092.  
  1093.     This "History" feature is very useful indeed when you are, for example,
  1094.     learning to use the stack by entering small sections of code at the
  1095.     interpreter command line.
  1096.  
  1097.  
  1098.     -------------
  1099.     Stack Display
  1100.     -------------
  1101.  
  1102.     Which brings us to the stack display at the top of the interpeter
  1103.     window.  This is a permanent feature of the interpeter display unless
  1104.     you are using the debugger, and it has been provided entirely for the
  1105.     benefit of anyone who is learning to use a stack oriented language like
  1106.     HelIOS for the first time.
  1107.  
  1108.     No other language goes to the trouble of providing such a useful feature
  1109.     just to help beginners, and we hope you will find it useful in getting
  1110.     used to the sometimes confusing concept of the HeliOS stack.
  1111.  
  1112.     The idea here is that you can play with stack operators at the command
  1113.     line while observing the program output on the main screen display and
  1114.     with a full display of the current state of the stack always present
  1115.     in the stack display area.
  1116.  
  1117.     Use the stack display to get a thorough understanding of how the stack
  1118.     is affected by various commands.  This is a unique feature of HeliOS,
  1119.     and is really worth exploiting while you are still learning to become
  1120.     familiar with parameter passing via the stack.
  1121.  
  1122.  
  1123.     -------------------
  1124.     Where to go now....
  1125.     -------------------
  1126.  
  1127.     HeliOS is a very large and flexible system, and the way you use it is
  1128.     down to your own personal preference.
  1129.  
  1130.     Please read the documentation on the user interface and general program
  1131.     functions before using HeliOS, because otherwise you may well miss many
  1132.     powerful features of the software which are not immediately obvious.
  1133.  
  1134.     When it comes to learning HeliOS programming, do not try to learn too
  1135.     much "theoretically" by reading documentation on all the hundreds of
  1136.     HeliOS commands before you start programming.  You will never learn
  1137.     everything this way and HeliOS has too many program commands to learn
  1138.     by simply reading about them in advance.
  1139.  
  1140.     HeliOS has been designed to be "interactive" and to allow creative and
  1141.     direct experimentation.  In spite of the advice given in many books
  1142.     on programming (whose authors have evidently never used or seen a good
  1143.     interactive computer language) do not be afraid to experiment "at the
  1144.     keyboard" and follow up your own ideas.
  1145.  
  1146.     Above all, try doing things which interest you, and try doing things
  1147.     you own way.  HeliOS provides an extremely "rich" set of commands in
  1148.     order to allow a wide choice of programming techniques.  There is no
  1149.     "right and wrong" way to do things (although you will find certain
  1150.     techniques more efficent than others), and you will always find that
  1151.     examining your own programs will reveal ways of improving them.  If
  1152.     you learn to do the simple things really well the large scale programs
  1153.     will come easily.
  1154.  
  1155.     HeliOS itself is constantly growing and evolving, and we would be
  1156.     pleased to hear your views on new features you would like to see as
  1157.     well as improvements you think would benefit other programmers.
  1158.  
  1159.     -----------------
  1160.     What to read next
  1161.     -----------------
  1162.  
  1163.     Having advised you not to read too much programming documentation to
  1164.     start with, you will nevertheless probably want to read through the
  1165.     HeliOS Language Tutorials provided to give you some insight into the
  1166.     basic concepts of HeliOS programming.
  1167.  
  1168.     You can best approach your first programming efforts by working with
  1169.     the example programs provided, and as you do so you can look up words
  1170.     which you do not understand in the HeliOS dictionary documentation.
  1171.  
  1172.     Use the example programs provided as a starting point for your own
  1173.     experiments and get used to how things work by changing the programs
  1174.     a little at a time to see what happens.
  1175.  
  1176.     As you start to write your own programs you will learn new commands and
  1177.     find which techniques suit you best: then you will gradually make use
  1178.     of more of the advanced features of HeliOS as you progress.
  1179.  
  1180.  
  1181.     --------------
  1182.     The Dictionary
  1183.     --------------
  1184.  
  1185.     As you write and gradually expand your first short HeliOS programs we
  1186.     recommend that you spend a little time reading the dictionary to learn
  1187.     more about how the commands you are using work.
  1188.  
  1189.     If you read the dictionary carefully, and learn new commands one at a
  1190.     time while simultaneously using them in interesting little programs,
  1191.     you will, in no time at all, have a confident command of the most vital
  1192.     HeliOS functions.
  1193.  
  1194.     The dictionary is the real source of all important information on how
  1195.     HeliOS works, and as the dictionary is ordered in sections relating to
  1196.     functionally connected words you may find it useful to read more about
  1197.     command words related to the ones you already know.  For example, you
  1198.     will soon know the words CURPUT and CURGET, but having gained confidence
  1199.     using these you should make a point of looking at all the other cursor
  1200.     functions too, in order to expand your repertoire of commands.
  1201.  
  1202.     When you are learning a new set of command words it is a good idea to
  1203.     experiment at the keyboard using the interpreter, and to write example
  1204.     programs to get a "hands on" feel for how everything works.
  1205.  
  1206.  
  1207.     ------------------------------
  1208.     A useful philosophical outlook
  1209.     ------------------------------
  1210.  
  1211.     The way you approach the large task of learning to program the Amiga
  1212.     will determine your success or failure.
  1213.  
  1214.     Most beginners quite rightly, and admirably, have a good idea of what
  1215.     they want to be able to do, and naturally they want to know "how to do
  1216.     it" quickly, assuming there is a relatively simple "know how" involved.
  1217.  
  1218.     The basic assumption is that the "experts" know something which enables
  1219.     them to "program the Amiga", like some kind of magic technique which
  1220.     will surely be found by reading some book or other........
  1221.  
  1222.     This is not "how it is" when you are programming the Amiga, and to
  1223.     avoid instant disillusionment here are a few things you might consider.
  1224.  
  1225.     Do not try to go to fast and do not become disillusioned when you
  1226.     realise that programming the Amiga is not going to be "easy".....
  1227.  
  1228.     The Amiga is a complex computer and many apparantly "easy" things take
  1229.     quite a lot of background programming: there simply are not too many
  1230.     "instant" tricks to do clever things, and the reality is that hard work
  1231.     and time are required before you write masterpieces.
  1232.  
  1233.     All the wonderful fluent and exciting software you see and wish to
  1234.     emulate has been created by very experienced programmers who have had
  1235.     to learn the "basics" first just like everyone else.  There are no real
  1236.     shortcuts, although HeliOS does try to give you as many fine automated
  1237.     tools as possible, and to make programming as enjoyable as possible.
  1238.  
  1239.     Do not start by trying to realise your "dream projects": before you
  1240.     try to do creative things it is best (necessary!) to concentrate on
  1241.     becoming fluent in the techniques and tools which will underpin all
  1242.     your future efforts.
  1243.  
  1244.     Like climbing a hill, it is better to keep your head down and take each
  1245.     small step carefully.  In fact, if you think about it, it is obvious
  1246.     that your dream program will never get written unless and until you
  1247.     personally have taken all the basic apparantly dull and insignificant
  1248.     steps which will be required to write it.
  1249.  
  1250.     You will not find your future masterpiece in any book written by someone
  1251.     else, and no amount of reading other people's ideas and reading other
  1252.     people's code will ever teach you as much as hands on experience down
  1253.     in the "engine room", learning by experience.  Do not waste too much
  1254.     time searching for that illusive book or file which will answer all
  1255.     your questions: it probably does not exist.
  1256.  
  1257.     Most beginner's spend more time trying fruitlessly to find "instant
  1258.     solutions" from other sources than they do actually learning to program.
  1259.     It may not be obvious, and it may not be too exciting, but the reality
  1260.     is that the most useful way to learn to program is to do-it-yourself:
  1261.     write your own small programs and learn fundamentals "at the keyboard".
  1262.  
  1263.     Do not expect to be told, or to read, "how to write an arcade game",
  1264.     as if there were only one way: you might indeed get hints and ideas
  1265.     from other people's code, but you will always do best to work things
  1266.     out for yourself when it comes to creating your final code.
  1267.  
  1268.     Above all, experiment and "play" with the computer: enjoy yourself
  1269.     trying out new ideas and doing things in new ways.  If you do not
  1270.     enjoy your programming you will have a long struggle.....and HeliOS
  1271.     is designed for creative programming and enjoyment.
  1272.  
  1273.     ----------------
  1274.     A starting point
  1275.     ----------------
  1276.  
  1277.     The file "Tutorial.src" will give you a simple start, so once you are
  1278.     bored reading tutorials you might like to try loading it into one of
  1279.     the editors.
  1280.  
  1281.     To run the Tutorial.src program once you have loaded it into an editor
  1282.     simply hold down SHIFT or CTRL or R-MOUSE while pressing the "Ed x"
  1283.     button of the editor containing the program - or use the menu option.
  1284.  
  1285.     Try experimenting with this program until you really feel confident
  1286.     that you understand it: this simple code can be a good basis for all
  1287.     your early HeliOS programs.
  1288.  
  1289.     -------------------
  1290.     Helios User Support
  1291.     -------------------
  1292.  
  1293.     We hope that you like using HeliOS and that you communicate your ideas
  1294.     to other HeliOS programmers by joining the HeliOS user group.
  1295.  
  1296.     Helios Software are also willing to help you directly with any problems
  1297.     you are experiencing, and for this reason we operate an advisory scheme
  1298.     whereby for a small charge we offer you help with any general HeliOS
  1299.     programming difficulty.
  1300.  
  1301.     ------------
  1302.     A final word
  1303.     ------------
  1304.  
  1305.     Thank you for purchasing HeliOS, and we hope that you will support
  1306.     our continued development of this excellent language by persuading
  1307.     your friends to pay the very reasonable purchase price rather than
  1308.     using a copied version.
  1309.  
  1310.     HeliOS is constantly evolving, and legitimate registered users will
  1311.     have the advantage of gaining a constant and regular stream of exciting
  1312.     new functions to use.
  1313.  
  1314.     It really is worthwhile for any HeliOS programmer to be a registered
  1315.     user, even if only to get the latest software updates, so please do
  1316.     support our efforts by discouraging piracy.
  1317.  
  1318.     We hope that you enjoy using this quality Helios product.
  1319.  
  1320.     Thank you.
  1321.  
  1322.     Helios Software
  1323.