Print Page as PDF
Classic FileMan API: File Lookup/Add New Entries ICR (10006)

Classic FileMan API: File Lookup/Add New Entries    ICR (10006)

Name Value
NUMBER 10006
IA # 10006
DATE CREATED 1998/11/18
CUSTODIAL PACKAGE VA FILEMAN
CUSTODIAL ISC San Francisco
USAGE Supported
TYPE Routine
DBIC APPROVAL STATUS APPROVED
ROUTINE DIC
NAME Classic FileMan API: File Lookup/Add New Entries
ORIGINAL NUMBER 10006
GENERAL DESCRIPTION
Entry point DIC is for general file lookups.  Entry
point IX if for a single cross reference lookups.
STATUS Active
ID DIC
COMPONENT/ENTRY POINT
COMPONENT/ENTRY POINT COMPONENT DESCRIPTION VARIABLES
DIC
Given a lookup value, this entry point searches a
file and either finds a matching entry, adds an entry, or returns a condition
indicating that the lookup was unsuccessful.
VARIABLES TYPE VARIABLES DESCRIPTION
DIC Input
(Required) The file number or an explicit global
root.
DIC(0) Input
(Required) A string of alphabetic characters which
alter how DIC responds.  At a minimum this string must be set to null. A
detailed description of these characters can be found later in this section.

Flag Short Description : A Ask the entry; if erroneous, ask again.  B Lookup
only on "B" index of cross-referenced pointed-to files for a match to X. Note:
this flag is introduced with patch DI*21*29. C Cross reference suppression is
turned off.  E Echo back information. F Forget the lookup value. I Ignore the
special lookup program. L Learning a new entry is allowed. M Multiple-index
lookup allowed. N Internal Number lookup allowed (but not forced).  O Only
find one entry if it matches exactly.  Q Question erroneous input (with two
??).  S Suppresses display of .01 (except B cross reference match).  X EXact
match required. Z Zero node returned in Y(0) and external form in Y(0,0).
X Both
Input: If DIC(0) does not contain an A, then the
variable X must be defined equal to the value you want to lookup. If the value
in X has more than one match or partial match, the lookup fails and Y=-1 is
returned.

Output: Contains the value of the field where the match occurred.
DIC("A") Input
(Optional) A prompt that is displayed prior to the
reading of the X input.
DIC("B") Input
(Optional) The default answer which is presented to
the user when the lookup prompt is issued.
DIC("S") Input
(Optional) DIC("S") is a string of MUMPS code that
DIC executes to screen an entry from selection. DIC("S") must contain an IF
statement to set the value of $T.
DIC("W") Input
(Optional) A MUMPS command string which is executed
when DIC displays each of the entries that match the user's input.
DIC("DR") Input
When calling DIC with LAYGO allowed, you can specify
that a certain set of fields will be asked for in the case where the user
enters a new entry.
DIC("P") Input
This variable is needed to successfully add the FIRST
subentry to a multiple when the descriptor (or header) node of the multiple
does not exist.
DIC("V") Input
If the .01 field is a variable pointer, it can point
to entries in more than one file. You can restrict the user's ability to input
entries from certain files by using the DIC("V") variable.
DLAYGO Input
(Optional) If this variable is set equal to the file
number, then the users will be able to add a new entry to the file whether or
not they have LAYGO access to the file.
DINUM Input
(Optional) This input variable identifies the
subscript at which the data is to be stored.
Y Output
DIC always returns the variable Y. The variable Y is
returned with one of these three formats:

Y=-1 The lookup was unsuccessful.  Y=N^S N is the internal number of the entry
in the file and S is the value of the .01 field for that entry.  Y=N^S^1 N and
S are defined as above and the 1 indicates that this entry has just been added
to the file.
Y(0) Output
This variable is only set if DIC(0) contains a Z.
When the variable is set, it is equal to the entire zero node of the entry
that was selected.
Y(0,0) Output
This variable is also only set if DIC(0) contains a
Z. When the variable is set, it is equal to the external form of the .01 field
of the entry.
DTOUT Output
This is only defined if DIC has timed-out waiting for
input from the user.
DUOUT Output
This is only defined if the user entered an up-arrow.

IX
This entry point is similar to ^DIC and MIX^DIC1 (see
DBIA #10007), except on how it uses cross-references to do lookup.
VARIABLES TYPE VARIABLES DESCRIPTION
DIC Input
The global root of the file.
DIC(0) Input
The lookup parameters as previously described for
^DIC.
D Input
The cross reference in which to start looking. If
DIC(0) contains M, then DIC will continue with further cross references. If it
does not, then the lookup is only on the single cross reference.
X Input
If DIC(0) does not contain an A, then the variable X
must be defined equal to the value you want to lookup.
DIC("A") Input
This set of input variables affects the behavior of
lookup as previously described for ^DIC.
DIC("B") Input
This set of input variables affects the behavior of
lookup as previously described for ^DIC.
DIC("DR") Input
This set of input variables affects the behavior of
lookup as previously described for ^DIC.
DIC("P") Input
This set of input variables affects the behavior of
lookup as previously described for ^DIC.
DIC("S") Input
This set of input variables affects the behavior of
lookup as previously described for ^DIC.
DIC("V") Input
This set of input variables affects the behavior of
lookup as previously described for ^DIC.
DIC("W") Input
This set of input variables affects the behavior of
lookup as previously described for ^DIC.
Y Output
DIC always returns the variable Y, which can be one
of the three following formats:

Y=-1 indicates the lookup was unsuccessful.  Y=N^S N is the Internal Number of
the entry in the file and S is the value of the .01 field for that entry.
Y=N^S^1 N and S are defined as above and the 1 indicates that this entry has
just been added to the file.
Y(0) Output
This variable is only set if DIC(0) contains a Z.
When it is set, it is equal to the entire zero node of the entry that was
selected.
Y(0,0) Output
This variable is also only set if DIC(0) contains a
Z. When it is set, it is equal to the external form of the .01 field of the
entry.
DTOUT Output
This is only defined if DIC has timed-out waiting for
input from the user.
DUOUT Output
This is only defined if the user entered an up-arrow.