First steps in HicEst

⇒Help ⇒Contents ⇒Help (⇒Optional Keywords Syntax)

Bookmarks:
  ⇒drop-down-menus list   ⇒first script   ⇒main program   ⇒menu item   ⇒prefabricated scripts
  1. Download and execute HicEst-setup.exe
  2. start HicEst and test a couple of

    prefabricated scripts

    (recommended):
  3. OK, try your

    first script

    :
    1. File → New → button "Menu template, this window"
    2. this opens a template:
      • CHARACTER MenuText*50, menus = "Replace; by your; own; menu; items; Help; items: Use MenuText or $$ in an if/then/elseif/else/endif construct; Good luck!;"
      •      WINDOW(Ti="you name it", Menu=menus, SelTxt=MenuText, x=1, Win=w1)
      • END
      • SUBROUTINE menus
      •     WRITE(win=w1, Name, ForeColor=$$) $$, MenuText
      •     IF( MenuText == "Help") DLG(Help="WINDOW()")
      • END
      • only strings and arrays need to be declared in HicEst. All numeric scalars are 8-byte floating point, even obvious integers as w1 or $$ in this example
      • the CHARACTER line defines the variables MenuText as a string of length 50, and menus as a string with the length defined by the initialization argument
      • the WINDOW line opens a window with the handle w1, a title, and a menu.
        1. The selected menu text is returned in MenuText.
        2. With the Menu=menus option a "SUBROUTINE menus" is required to do the work when a menu item is selected. This is called a CALLback subroutine.
        3. The x=1 option positions the window on the right border
      • the first END statement terminates the

        main program

      • "SUBROUTINE menus" is called on the selection of a

        menu item

        . The item number selected is always in the global variable $$. In addition, when the menu window was created with the SelTxt option, the text string of the menu item is returned in the SelTxt argument
      • the WRITE line writes the values of $$ and MenuText the window with handle w1. The Name option prefixes the values with their symbolic names. ForeColor=$$ paints the output, ⇒ Colors
      • the IF line is a very short example of a conditional execution. Instead of the display of the WINDOW help dialog it is usually replaced by something like
        • IF($$ == 1) THEN
        • ...
        • ELSEIF(MenuText == "Help") THEN
        • ...
        • ELSEIF( KEY(SHift) * ($$ > 5) ) THEN
        • ...
        • ELSE
        • ...
        • ENDIF
      • the conditions are evaluated from top to bottom. Any kind of mixed logical expressions is allowed, e.g. the test whether the shift key is pressed AND the menu item nr is > 5. This can come handy while debugging your script.
      • the second END statement terminates the callback subroutine menus
      After clicking a few menu items:
    3. Surely, the WINDOW-menu or the WINDOW-Toolbar options are nice for well structured scripts. But if you are in a real hurry select File → New → button "Blank template, this window". This will open a minimalistic script
      • END
      Here you are free to do the wildest things in the twinkling of an eye. But just remember this is bad style and it is not recommended. Unfortunately, most users seem do it anyhow, ourselves included
  4. Make a few changes to the script to get the feeling:
  5. ⇒ The elements of programming in HicEst


©2000-2008 Georg Petrich, HicEst Instant Prototype Computing. All rights reserved.
Impressum