ALPHA ALPHA ALPHA ALPHA ALPHA ALPHA ALPHA ALPHA ALPHA ALPHA ALPHA ALPHA ALPHA

This is a *very* short (and not yet ready) description of invoking SETUP.EXE,
it's syntax and the available builtin functions.


Invoking SETUP.EXE
==================

  setup [ options, ... ] [ menufile ]

were is

  options

     -v       Verbose memory requirements at termination.
     -Dname   Define a 'void' variable, that can be used together
              with #ifdef, #ifndef in the menu file.
              (conditional parsing of the menu file)

  menufile    Name of a file which will be parsed and executed.
              The default extension is '.mnu', the default directory
              were it is expected is the same as SETUP.EXE is in,
              as long as 'menufile' is not prefixed by any explicit
              directory name.
              If 'menufile' is omitted it is SETUP.MNU by default.



Syntax of the menu file:
========================

Conditional parsing and file including:
---------------------------------------

The following has similar effect as within the C-macro preprocessor
This is completely handled by the scanner, so the parser will not
see any 'false' part of the conditionals.

  #ifdef  variable
  #else
  #endif

  #ifndef  variable
  #else
  #endif

To include files up to a depth of 10 you may use

  #include "file"

were 'file' (NOTE you need the double quotes ") is within the same
directory as is the 'main' menu file, as long as it is not prefixed
by any explicit directory name. There is no default extension expected.


Grammar of the menu file:
------------------------

In the Syntax -parts of the following description we have these rules:

All keywords or builtins are underlined e.g:

  start <menuname>
  -----

  where
    "start"    is a keywort and
    <menuname> is an user chosen identfier (whithout the angle brackets).

Any optional parts are surounded by [ ].

All other text is description or example.



-------------------------------
Syntax:   start <menuname>
          -----

Function: This defines the name of the menu, which is the top one.
          The menu <menuname> will show up if SETUP has read in
          the menufile. It's comparable to the main() function in C.


-------------------------------
Syntax:   <name>: menu ( geometry ) {  image { .. }  action { .. }  }
                  ----                 -----         ------

Function: This defines a menu (can be shown on screen) under a given "name".
          "geometry" defines where and how it is displayed (see below)
          The "image" will be display, and the the "action" is executed.

Arguments:

          Syntax of ( geometry ) :

          ( x, y, xsize, ysize, frame
            [ ,frameattr [,normattr [,inversattr [,highlightattr] ] ] ] )




-------------------------------
Syntax:   image { <identifier> | string }
          -----

Function: Defines the text to be displayed, when the menu is shown.

Arguments:
         <identifier> point to string (a string variable)

         "string" is any concatenation of:

             " This is a text \n" 'this also'
             " and with this"'"'" we can can print a quote"
             " After this word
               there is an unvisable \n "




-------------------------------
Syntax:   action { statement [ statement ... ] }

Function: After the image has been displayed the programm contained
          in the action part is executed.

          Here is a list of the possible statement:

             show ( <menu> [,image [, action]] )
             waitkey ( [ keypattern ] )
             printxy (x,y, text [, attr] )
             call <builtin> (...)
             call <ownfunction> ()
             goto <labelname>
             iftrue goto <labelname>
             iffalse goto <labelname>
             iferror goto <labelname>
             ifnoterror goto <labelname>
             <labename>: label
             set <variable> = value
             set <variable> = <src-variable>
                 Note: If 'src-variable' does not exist at runtime
                       'variable' is left unchanged.
                       With 'iferror/ifnoerror' this condition can be checked.
             set <variable> = ( arithm. expression )

          and here is a list of the available builtin functions

             call get_default_drive ()
             call sysinfo (<dest>)
/* call sysinfo (sysinfolist)
   sysinfonlist = stringlist containing the following items:

   1:  current drive ("A","B","C",...)
   2:  installed RAM int units of 1KB
   3:  actual date,  format: JJJJ MM DD
   4:  actual date,  format: jjmmdd   (compareable number)
   5:  actual local time,  format: HH:MM:SS
   6:  actual local time,  format: hhmmss   (compareable number)
*/
             call getkey (<dest> [,matchpattern [,toupper]])
             call enterstring (<dest>, numberof lines)
             call buttons ( stringlist )
             call scrollbar ( <destlist>, <scrollmenu>, step, [<helpmenu>] )
             call strcat (<dest>, source)
             call strprefix (<dest>, source)
             call stringequal ( string1, string2 )
             call numbercmp(howtocompare, string1,string2)    ; string must contain number
             call strcpyitem  (<dest>, sourcelist, item [, step])
             call translate(<dest>,string, codetable)  ; codetable = pairs of characters
             call printf ( format, args, ... )
             call sprintf (<dest>, format, args, ... )
             call sscanf ( sourcestring, format, <dest>,  ... )
             call showfile ( filename )
             call exit ( exitmessage )
             call system ( <destlist>
             call disk_rawrite (filename, driveletter, [ fmt1, fmt2, fmt3, fmt4 ] )
             call exec_loadlin (loadlinpath, arg1, arg2, ...)
             call restart_myself ( arg1 [, arg2, ...] )



-------------------------------
Syntax:   |

Function: |
