home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / clarion / ext_key.zip / EXT_KEY.TXT < prev    next >
Text File  |  1992-04-08  |  2KB  |  61 lines

  1.  
  2.                                4/6/92
  3.  
  4.                -  Clarion Technical Support  -
  5.  
  6.      This program shows one way to use the EXTERNAL statement.
  7.     In this example the EXTERNAL statement is used to pass a key
  8.     name to a table procedure.    Passing structures and fields
  9.     externally allows you to create "generic" procedures or functions.
  10.     This example has a generic TABLE procedure that display records
  11.     from a file depending on the KEY that is passed to it from the
  12.     MENU procedure.  Both the TABLE and the MENU have been converted
  13.     to "OTHER" procedures since Designer does not support external
  14.     parameters on menu items.
  15.  
  16.  
  17.     4 Important Notes:
  18.  
  19.     1) In Designer, you will not be able to use external parameters
  20.     on menu items.  Designer is not setup to handle external parameters
  21.     on menu items. However, anywhere Designer gives you the ability
  22.     to enter your own code you can use external parameters on your
  23.     procedure calls.
  24.  
  25.     2) A good example of how to pass a file name as an external parameter
  26.     is in the 218A model files.     Since the code used to open or share
  27.     a file is exactly the same except for the file name, as of release
  28.     2108,  the G_OPENFILES() procedure passes the file name (externally)
  29.     to the G_OPENFILES2() procedure.  This G_OPENFILES2() procedure
  30.     contains all the code necessary to open a file.  This eliminates
  31.     the need for redundant code.
  32.  
  33.     3) When passing structures you must also pass any items in that
  34.     structure that you plan on referencing in the called procedure.
  35.     EX.     If you pass a key name as an external parameter the fields
  36.     in that key CANNOT be referenced unless they are passed also.
  37.  
  38.     4) Structures passed externally require a KEYWORD attribute to
  39.     identify them. ie,
  40.  
  41.       FILEA        EXTERNAL,FILE
  42.       KEYX        EXTERNAL,KEY
  43.       SCREENG   EXTERNAL,SCREEN
  44.       ARRAYV    EXTERNAL,DIM(1,1)      !Pg. 3-25 Lang Ref Man.
  45.       DOSFILE   EXTERNAL,DOS
  46.       REPORTH   EXTERNAL,REPORT
  47.       TABLEQ    EXTERNAL,TABLE
  48.  
  49.        Fields and variables only require the EXTERNAL attribute.
  50.        ie,
  51.       field1    EXTERNAL
  52.       field2    EXTERNAL
  53.       var1        EXTERNAL
  54.       pointer   EXTERNAL
  55.       counter   EXTERNAL
  56.  
  57.  
  58.  
  59.  
  60.  
  61.