Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Artful Two for Clipper 5.0 - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

  The_Usual() needs an initialisation function, which creates
  the menu and the arrays of field names, titles and pictures to
  use in the browse window.

  The design of the initialisation function stems from Summer '87
  architecture, and has been preserved for backward compatibility.
  The_Usual() calls the initialisation function three times. The
  first two calls simply return the sizes of the required array.
  The third call fills the arrays.

  When The_Usual() is called, it looks in the Dictionary field
  udf_field for the name of the initialisation function. In a
  default call to The_Usual(), you don't have to write anything
  in this field. (Detecting a blank, the dictionary validation
  routine fills in the name Set_Table, which provides default
  functionality.)

  When you write the name of your custom initialisation routine
  in the dictionary, do not include the parentheses.

  Finally, your initialisation function must be named using the
  three-character prefix in the Dictionary.

Example

  FUNCTION ART_INIT( nCallNumber )     // prefix is ART
  LOCAL result := -1
  DO CASE
     CASE nCallNumber == 1            // send back number of browse fields
        result := DICT->Brows_flds
     CASE nCallNumber == 2            // send back menu size
        result := 9 + IF( DICT->No_Kids > 0, 1, 0 )
     CASE nCallNumber == 3            // result is unimportant here
        SET_BROWSE()
        result := MYMENU()
  ENDCASE
  RETURN result

  FUNCTION MYMENU     // Trim the usual menu down to minimal items
  LOCAL x
  /*
     the arrays choices, udfs and menu_msg are
     declared by The_Usual() and inherited here.
  */
  choices := { " Add ", ;
               " Edit ", ;
               " Find ", ;
               " Query " ;
             }
  udfs    := { DICT->Udf_Add, ;
               DICT->Udf_Edit, ;
               DICT->Udf_Search, ;
               DICT->Udf_Query ;
             }
  IF DICT->Menu_mesgs      // logical toggle messages on and off
     menu_msg := { "Add a record to the file", ;
                   "Edit the current record", ;
                   "Find a record in the file", ;
                   "Select a set of records matching your criteria" ;
                 }
  ENDIF
  RETURN 1

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson