home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
clarion
/
ext_key.zip
/
EXT_KEY.TXT
< prev
next >
Wrap
Text File
|
1992-04-08
|
2KB
|
61 lines
4/6/92
- Clarion Technical Support -
This program shows one way to use the EXTERNAL statement.
In this example the EXTERNAL statement is used to pass a key
name to a table procedure. Passing structures and fields
externally allows you to create "generic" procedures or functions.
This example has a generic TABLE procedure that display records
from a file depending on the KEY that is passed to it from the
MENU procedure. Both the TABLE and the MENU have been converted
to "OTHER" procedures since Designer does not support external
parameters on menu items.
4 Important Notes:
1) In Designer, you will not be able to use external parameters
on menu items. Designer is not setup to handle external parameters
on menu items. However, anywhere Designer gives you the ability
to enter your own code you can use external parameters on your
procedure calls.
2) A good example of how to pass a file name as an external parameter
is in the 218A model files. Since the code used to open or share
a file is exactly the same except for the file name, as of release
2108, the G_OPENFILES() procedure passes the file name (externally)
to the G_OPENFILES2() procedure. This G_OPENFILES2() procedure
contains all the code necessary to open a file. This eliminates
the need for redundant code.
3) When passing structures you must also pass any items in that
structure that you plan on referencing in the called procedure.
EX. If you pass a key name as an external parameter the fields
in that key CANNOT be referenced unless they are passed also.
4) Structures passed externally require a KEYWORD attribute to
identify them. ie,
FILEA EXTERNAL,FILE
KEYX EXTERNAL,KEY
SCREENG EXTERNAL,SCREEN
ARRAYV EXTERNAL,DIM(1,1) !Pg. 3-25 Lang Ref Man.
DOSFILE EXTERNAL,DOS
REPORTH EXTERNAL,REPORT
TABLEQ EXTERNAL,TABLE
Fields and variables only require the EXTERNAL attribute.
ie,
field1 EXTERNAL
field2 EXTERNAL
var1 EXTERNAL
pointer EXTERNAL
counter EXTERNAL