Print Page as PDF
Data Base Server API: Misc. Library Functions ICR (2054)

Data Base Server API: Misc. Library Functions    ICR (2054)

Name Value
NUMBER 2054
IA # 2054
DATE CREATED 1997/07/02
CUSTODIAL PACKAGE VA FILEMAN
CUSTODIAL ISC San Francisco
USAGE Supported
TYPE Routine
DBIC APPROVAL STATUS APPROVED
ROUTINE DILF
NAME Data Base Server API: Misc. Library Functions
GENERAL DESCRIPTION
Various libaray functions.

CLEAN: Array and Variable Clean-up $$CREF: Root Converter (Open to Closed
Format) DA: DA( ) Creator DT: Date Converter FDA: FDA Loader $$IENS: IENS
Creator $$OREF: Root Converter (Closed to Open Format) $$VALUE1: FDA Value
Retriever (Single) VALUES: FDA Values Retriever
STATUS Active
ID DILF
COMPONENT/ENTRY POINT
COMPONENT/ENTRY POINT COMPONENT DESCRIPTION VARIABLES
CLEAN
This procedure kills the standard message arrays and
variables that are produced by VA FileMan.
None
$$CREF()
This extrinsic function converts the traditional open
root format to the closed root format used by subscript indirection.

Format $$CREF^DILF(OPEN_ROOT)
VARIABLES TYPE VARIABLES DESCRIPTION
OPEN_ROOT Input
(Required) An open root which is a global root ending
in either an open parenthesis or a comma.
DA()
This procedure converts an IENS into an array with
the structure of a DA() array.

Format DA^DILF(IENS,.DA)
VARIABLES TYPE VARIABLES DESCRIPTION
IENS Input
(Required) A string with record and subrecord numbers
in IENS format.
.DA Both
(Required) The name of the array which receives the
record numbers. NOTE: This array is cleaned out (killed) before the record
numbers are loaded.
DT()
This procedure converts a user-supplied value into VA
FileMan's internal date format and (optionally) into the standard VA FileMan
external, readable date format.

Format DT^DILF(FLAGS,IN_DATE,.RESULT,LIMIT,MSG_ROOT)
VARIABLES TYPE VARIABLES DESCRIPTION
FLAGS Input
(Optional) Control processing of user input and the
type of output returned. Generally, FLAGS is the same as %DT input variable to
^%DT entry point, with the following exceptions: "A" is not allowed and the
meaning of "E" is different (see below). The possible values are:

E External, readable date returned in zero-node of RESULT.  F Future dates are
assumed.  N Numeric-only input is not allowed.  P Past dates are assumed.  R
Required time input.  S Seconds will be returned.  T Time input is allowed but
not required.  X EXact date (with month and day) is required.
IN_DATE Input
(Required) Date input as entered by the user in any
of the formats known to VA FileMan.
.RESULT Both
(Required) Local array that receives the internal
value of the date/time and, if the "E" flag is sent, the readable value of the
date.

Output Output is returned in the local array passed by reference in the RESULT
parameter, shown below:

RESULT Date in internal FileMan format. If input is invalid or if help is
requested with a "?", -1 is returned.

RESULT(0) If requested, date in external, readable format. When appropriate,
error messages and help text are returned in the standard manner in ^TMP or in
MSG_ROOT (if it is specified).
LIMIT Input
(Optional) A value equal to a date/time in FileMan
internal format or NOW.  IN_DATE is accepted only if it is greater than or
equal to LIMIT if it is positive, or less than or equal to LIMIT if it is
negative. This is equivalent to the %DT(0) variable in the ^%DT call.
MSG_ROOT Both
(Optional) Root into which error, help, and message
arrays are put.
FDA()
This procedure can be used to load data into the FDA.
It accepts either the traditional DA( ) array or the IENS for specifying the
entry. No validation of VALUE is done.

Format 1. FDA^DILF(FILE,IENS,FIELD,FLAGS,VALUE,FDA_ROOT,MSG_ROOT)

2. FDA^DILF(FILE,.DA,FIELD,FLAGS,VALUE,FDA_ROOT,MSG_ROOT)
VARIABLES TYPE VARIABLES DESCRIPTION
FILE Input
(Required) File or subfile number.
.DA Input
(Required for format 2) DA() array containing entry
and subentry numbers.
IENS Input
(Required for format 1) Standard IENS indicating
internal entry numbers.
FIELD Input
(Required) Field number for which data is being
loaded into the FDA.
FLAGS Input
(Optional) Flag to control processing:

R Record identified by IENS or .DA is verified to exist. Do not use the "R"
FLAG if the IENS or DA() array contain placeholder codes instead of actual
record numbers.
VALUE Input
(Required, can be null) Value to which the FDA node
will be set.
FDA_ROOT Both
(Required) The root of the FDA in which the new node
is loaded.
MSG_ROOT Both
(Optional) Root into which error, help, and message
arrays are put. If this parameter is not passed, these arrays are put into
nodes descendent from ^TMP.
$$IENS()
This extrinsic function returns the IENS when passed
an array in the traditional DA() structure.

Format $$IENS^DILF(.DA)
VARIABLES TYPE VARIABLES DESCRIPTION
.DA Both
Input Parameters .DA (Required) An array with the
structure of the traditional VA FileMan DA() array-that is, DA=lowest subfile
record number, DA(1)=next highest subfile record number, etc.


Output A string of record numbers in the IENS format-that is,
"DA,DA(1),...DA(n),".
$$OREF()
This extrinsic function converts a closed root to an
open root. It converts an ending close parenthesis to a comma.

Format $$OREF^DILF(CLOSED_ROOT
VARIABLES TYPE VARIABLES DESCRIPTION
CLOSED_ROOT Input
(Required) A closed root, which is a global root
ending in a closed parenthesis.
$$VALUE1()
This extrinsic function returns the value associated
with a particular file and field in a standard FDA. Only a single value is
returned.

Format $$VALUE1^DILF(FILE,FIELD,FDA_ROOT)
VARIABLES TYPE VARIABLES DESCRIPTION
FILE Input
(Required) File or subfile number.
FIELD Input
(Required) Field number for which data is being
requested.
FDA_ROOT Input
(Required) The root of the FDA from which data is
being requested.
VALUES()
This procedure returns values from an FDA for a
specified field.

Format VALUES^DILF(FILE,FIELD,FDA_ROOT,.RESULT)
VARIABLES TYPE VARIABLES DESCRIPTION
FILE Input
(Required) File or subfile number.
FIELD Input
(Required) Field number for which data is being
requested.
FDA_ROOT Input
(Required) The root of the FDA from which data is
being requested.
.RESULT Both
(Required) Local array that receives output from the
call. The array is killed at the beginning of each call.
LOCK()
The purpose is to lock a global reference using VA
FileMan's Lock time out value(DILOCKTM).  Format: LOCK^DILF(resolved global
reference) Input: RESOLVED GLOBAL REFERENCE - (Required)This is the fully
resolved global reference.  Output: $Truth value - 1 equals lock obtained; 0
equals lock failed Example: >S REF="^MYFILE(123,1,0)" >D LOCK^DILF(REF) >W $T
1 >W DILOCKTM 3
VARIABLES TYPE VARIABLES DESCRIPTION
REF Both
Input: RESOLVED GLOBAL REFERENCE - (Required) This is
the fully resolved global reference.

Output: $Truth value - 1 equals lock obtained; 0 equals lock failed.