Contextual data representation and retrieval method6470490Abstract A method for information representation and retrieval within a general-purpose digital computer. Information of all simple types is represented as points along dimensions, and compound information types are represented as the intersection of two or more dimensions in a multidimensional data space. A context of points is maintained externally, and is used selectively by an evaluator function which is used to return values which are bound to points in this data space, and to invoke conventional data processing functions which interact with the data space. Using the multidimensional representation and retrieval method, the processes and structures of conventional computing, such as variables, arrays, structures, lists, objects, and the like may be modeled or simulated. Claims I claim as my invention: Description FIELD OF THE INVENTION
Point Data Structure
#define V4DPI_PntType_Int 0 /*
Integer Point Value */
#define V4DPI_PntType_Char 1 /*
Character String */
#define V4DPI_PntType_Dict 2 /*
Dictionary Entry */
#define V4DPI_PntType_Real 3 /* Real
Number */
#define V4DPI_PntType_Isct 4 /*
Intersection (Grouping is number of
points
in the intersection) */
#define V4DPI_PntType_Foreign 5 /*
Foreign data type (ex: qtyuom) */
#define V4DPI_PntType_Special 6 /*
Special points (e.g. (ALL), (CURRENT)) */
#define V4DPI_PntType_Shell 7 /* This
is a shell for other points */
#define V4DPI_PntType_FrgnDataE1 8 /* Field
specification for foreign file */
#define V4DPI_PntType_FrgnStructE1 9 /*
Structure specification for a foreign file */
#define V4DPI_PntType_CmpndIsct 10 /*
Compound Intersection: dim=[ ... ], [ ... dim= ]
... */
#define V4DPI_PntType_V3Mod 11 /* V3
Module Call */
#define V4DPI_PntType_V3ModRaw 12 /* V3
Module Call with no translation (points passed "as is") */
#define V4DPI_PntType_Context 13 /* A
Context point */
#define V4DPI_PntType_List 14 /* A
"special" (internally maintained) list */
#define V4DPI_PntType_Pragma 15 /* A
point which holds junk for IntMods,
not to
be pushed onto context */
#define V4DPI_PntType_IntMod 16 /* A
point which evaluates via internal (to
V4)
module */
#define V4DPI_PntType_PntIdx 17 /* A
point which points to internal point
buffer
("expanded" by V4) */
#define V4DPI_PntType_MemPtr 18 /* A
memory pointer */
#define V4DPI_PntType_V3PicMod 19 /* A V3
PIC module (module stored in same area as point?) */
#define V4DPI_PntType_BigText 20 /* A big
text string (see V3PicMod above) */
#define V4DPI_PntType_PIntMod 21 /*
Partial Eval IntMod (last argument is continued evaluation) */
#define V4DPI_PntType_Time 22 /*
Time/Transaction - Bindings searched in
reverse
"chronological" order */
#define V4DPI_PntType_Binding 23 /*
Binding info - used for erasing/tracking bindings */
#define V4DPI_PntType_Logical 24 /*
Logical (Yes/No) */
#define V4DPI_PntVerify_InArea 1 /*
Verify point in Area */
#define V4DPI_PntVerify_Dict 2 /*
Verify point in dictionary */
#define V4DPI_PntVerify_Range 3 /* Point
must be within range */
#define V4DPI_PntVerify_Ref 4 /*
Verify point as REF in another area */
#define V4DPI_Grouping_Single 0 /*
Single Point */
/* Numbers 1-12 indicate a mix-list of so many entries */
#define V4DPI_Grouping_All 15 /* Point
represents all points in dimension
(e.g.
dim=all) */
#define V4DPI_Grouping_Current 16 /* Point
represents current value of dimension in
context
*/
#define V4DPI_Grouping_Binding 17 /* Point
represents value of point in binding
resulting in this intersection */
#define V4DPI_Grouping_List 18 /* Point
represents value of point within
current
list iteration */
#define V4DPI_Grouping_Now 19 /* Point
represents "current" time */
#define V4DPI_Grouping_LastBind 20 /* Point
represents bind point of last binding */
#define V4DPI_AlphaVal_Max 1024 /* Max
bytes in a point value */
#define V4DPI_CharString_Max 250 /* Max
bytes in character string */
#define V4DPI_PointHdr_Bytes 8 /*
Number of bytes in point header */
#define V4DPI_FormatOpt_ShowDim /* Show
"dim=" in output */
#define V4DPI_FormatOpt_ShowBytes 2 /* Show
bytes required to store point */
#define V4DPI_FormatOpt_Trace V4DPI_FormatOpt_ShowDim .vertline.
V4DPI_FormatOpt_ShowBytes
#define V4DPI_FormatOpt_Default 0
struct V4DPI_Point
{ unsigned short Dim ; /*
Dimension of this point */
unsigned short Bytes ; /*
Number of bytes in this point */
unsigned char PntType ; /* Type
of point - see V4DPI_PntType_xxx */
unsigned char Grouping ; /*
Grouping of points - see V4DPI_Grouping_xxx */
unsigned char LHSCnt /* If
intersection then number of points below
before
".vertline." i (left-hand-size count) */
CHARFIELD NestedIsct : 1 ; /* If
this is intersection then TRUE if
nested
intersections within */
CHARFIELD Quoted : 1 ; /* If
TRUE then point is "quoted" and should not
be
evaluated */
union
{ int IntVal ;
char *MemPtr ; /*
Pointer to memory */
unsigned char AlphaVal[V4DPI_AlphaVal_Max]
} Value
} ;
typedef struct V4DPI_Point P ; /* To
make life easier */
#define V4DPI_ShortAlphaVal_Max 8
#define V4DPI_ShortPointHdr_Bytes 4
#define V4DPI_Shortpoint_Limit V4DPI_ShortAlphaVal_Max+V4DPI_PointHdr_Bytes
struct V4DPI_ShortPoint /* Used
for "little points" stored directly within bindlist */
{ unsigned short Dim ; /*
Dimension of this point */
unsigned short Bytes ; /*
Number of bytes in this point */
unsigned char PntType ; /* Type
of point - see V4DPI_PntType_xxx */
union
{ int IntVal ;
char AlphaVal[V4DPI_ShortAlphaVal_Max] ;
} Value ;
} ;
Dimension Data Structure
#define V4DPI_WorkRelHNum 7 /* RelH
for process-specific work area */
#define V4DPI_DimInfo_DimNameMax 31 /* Max
bytes in dimension name */
#define V4DPI_DimInfo_RelHReview_Const 1 /*
Bindings are defined at dimension
definition - cannot change */
#define V4DPI_DimInfo_RelHReview_Area 0 /*
Review RNum/Category whenever an
area is
loaded or unloaded */
#define V4DPI_DimInfo_RelHReview Bind 2 /*
Review with each binding for this
dimension (VERY EXPENSIVE OPTION!!) */
struct V4DPI_DimInfo
{ union V4IS_KeyPrefix kp ; /*
Type=V4, SubType=DimInfo, Mode=Int,
Length=8
*/
int DimId /*
Dimension code (actually dictionary entry for
Dim
name) */
char DimName[V4DPI_DimInfo_DimNameMax+1] ;
short PointType ; /* Type
of point allowed for this dimension-
V4DPI_PntType_xxx */
short PointVerify ; /* How
to verify (accept) this point-
V4DPI_PntVerify_xxx */
short RangeOK ; /* TRUE
if point ranges (xxx..yyy) are allowed */
short ListOK ; /* TRUE
if point lists (xxx,yyy,zzz) are allowed
*/
short IsModule ; /* TRUE
if point links to external (V3) module */
short UniqueOK ; /* If
TRUE then allowed to specify point as
dim={NEW} */
short DictType ; /*
Dictionary type- V4DPI_DictType_xxx */
int BindList ; /* If
TRUE then dimension can become key to
BindList
entry */
short ExpandMacro ; /*
Number of bytes in macro below (i.e.
TRUE if
expansion on parse) */
char Macro_Buf[100+1] ; /* Macro
buffer to expand on point acceptance */
short RelHNum ; /*
Relative Heirarchy Number for this dimension
(for
bindings) */
char RelHCategory[31+1] ; /*
Category code for bindings */
short RelHReview ; /* How
often to review RelHNum/Category-
V4DPI_DimInfo_RelHReview_xxx */
char AcceptorModule[31+1] ; /* Name
of V3 Acceptor module */
int AcceptorObject[2] ; /*
OBJREF for acceptor module */
char DisplayerModule[31+1] ; /* Name
of V3 Displayer module */
int DisplayerObject[2] ; /*
OBJREF for displayer */
/*
Following MUST be at end of dimension info !!!*/
struct V4DPI_Point AutoCtxPnt ; /* If
not NULL then point to be used for Auto-
Context
lookups */
} ;
struct V4DPI_DimUnique /*
Structure of record holding next
available point number for a dimension */
{ union V4IS_KeyPrefix kp ; /*
Type=V4, SubType=DimInfo, Mode=Int,
Length=8
*/
int DimId ; /*
Dimension code */
unsigned long NextAvailPntNum ; /* Next
available number (will have RelH prefix!)
[SHOULD
BE UNSIGNED!!!] */
} ;
#define V4DPI_PointIntMix_Max 12
struct V4DPI_Point_IntMix /*
Defines a list of integer points/ranges */
{ struct ( int BeginInt,EndInt ; /* Begin
& End in range (end=begin for single) */
} Entry[V4DPI_PointIntMix_Max] ;
} ;
#define V4DPI_PointAlphaMix_Max 12 /* Max
number of Alpha mixes in point */
struct V4DPI_PointAlphaMix
{ struct { unsigned short BeginIndex
unsigned short EndIndex
} Entry[V4DPI_PointAlphaMix_Max] ;
} ;
union V4DPI_PointMask
EXAMPLES OF IMPLEMENTATION Procedural Language (Data) In using the method of the present invention to approximate the variable structures of conventional high-level programming languages, for example, one would establish dimensions and bindings as follows: NId--a dimension for the names of things in the program. Program--a dimension for points corresponding to each program in the system. Proc--a dimension for points corresponding to each procedure declared in the programs. Invoke--a dimension for points corresponding to each procedure invocation (created as the program executed). The variables in the programs may then be thought of as the following bindings: global heap [NId=var , Program=name] local dynamic [NId=var , Proc=procedure , Invoke=frame] local heap [NId=var, Proc=procedure] In such a structure, if Program, Proc, and Invoke are established as part of the context C, then each type of variable may be referenced simply with NId points (that is, the variable name), in the same manner as in conventional programming. Maintenance of the context may be performed independently of the program (in a manner analogous to the operation of the internal code generated by compilers for managing frame, heap, stack and other memory control structures.) Database Definition Example DataEl=(5109,1, CHECK_NUMBER,APO_CHECK_NUMBER,1,0,1,0,4,0) Bind [Field=CHECK_DATE FileRef=5109 DataEl] DataEl=(5109,2, CHECK_DATE,EXEC_KO_DATE,1,0,1,4,4,0) Bind [Field=CASH_ACCOUNT FileRef=5109 DataEl] DataEl=(5109,3, CASH_ACCOUNT,APO_CASH_ACCOUNT,15,0,1,8,2,0) Bind [Field=TTL_CHECK_AMT FileRef=5109 DataEl] DataEl=(5109,4, TTL_CHECK_AMT,EXEC_KO_MONEY,1,0,1,12,4,2) Bind [Field=TTL_DISCOUNT_AMT FileRef=5109 DataEl] DataEl=(5109,5, TTL_DISCOUNT_AMT,EXEC_KO_MONEY,1,0,1,16,4,2) Bind [Field=TTL_APPLY_AMT FileRef=5109 DataEl] DataEl=(5109,6, TTL_APPLY_AMT,EXEC_KO_MONEY,1,0,1,20,4,2) Bind (Field=SORT1 FileRef=5109 DataEl) DataEl=(5109,7, SORT1, EXEC_KO_ALPHA,3,0,1,24,10,0) Bind [Field=NAME FileRef=5109 DataEl] DataEl=(5109,8, NAME,EXEC_KO_ALPHA,3,0,1,34,30,0) Bind [Field=ADDRESS1 FileRef=5109 DataEl] DataEl=(5109,9, ADDRESS1, EXEC_KO_ALPHA,3,0,1,64,30,0) Bind [Field=ADDRESS2 FileRef=5109 DataEl] DataEl=(5109,10, ADDRESS2, EXEC_KO_ALPHA,3,0,1,94,30,0) Bind [Field=CITY FileRef=5109 DataEl] DataEl=(5109,11, CITY,EXEC_KO_ALPHA,3,0,1,124,30,0) Bind [Field=ADDRESS3 FileRef=5109 DataEl] DataEl=(5109,12, ADDRESS3, EXEC_KO_ALPHA,3,0,1,154,30,0) Bind [Field=ADDRESS4 FileRef=5109 DataEl] DataEl=(5109,13, ADDRESS4, EXEC_KO_ALPHA,3,0,1,184,30,0) Bind [Field=ZIP FileRef=5109 DataEl] DataEl=(5109,14, ZIP,APO_GEN_UZIP,1,0,1,216,4,0) Bind [Field=ZIPXTRA FileRef=5109 DataEl] DataEl=(5109,15, ZIPXTRA,EXEC_KO_ZIPXTRA,3,0,1,220,16,0) Bind [Field=STATE FileRef=5109 DataEl] DataEl=(5109,16, STATE,EXEC_KO_UCALPHA,3,0,1,236,2,0) Bind [Field=COUNT FileRef=5109 DataEl] DataEl=(5109,17, COUNT,EXEC_KO_INTEGER,15,0,1,238,2,0) Bind [Field=SEL_INDEX FileRef=5109 DataEl] DataEl=(5109,18, SEL_INDEX,EXEC_KO_INTEGER,15,0,2,0,2,0) Bind [Field=APOPNITM_ID FileRef=5109 DataEl] DataEl=(5109,19, APOPNITM_ID,APO_APOPNITM_ID,1,0,2,4,4,0) Bind [Field=VENDOR_INVOICE FileRef=5109 DataEl] DataEl=(5109,20, VENDOR_INVOICE,APO_VENDOR_INVOICE,3,0,2,8,15,0) Bind [Field=VENDOR_INV_DATE FileRef=5109 DataEl] DataEl=(5109,21, VENDOR_INV_DATE,EXEC_KO_DATE,1,0,2,24,4,0) Bind [Field=COMMENTS FileRef=5109 DataEl] DataEl=(5109,22, COMMENTS,EXEC_KO_ALPHA,3,0,2,28,30,0) Bind [Field=CHECK_AMT FileRef=5109 DataEl] DataEl=(5109,23, CHECK_AMT,EXEC_KO_MONEY,1,0,2,60,4,2) Bind [Field=DISCOUNT_AMT FileRef=5109 DataEl] DataEl=(5109,24, DISCOUNT_AMT,EXEC_KO_MONEY,1,0,2,64,4,2) Bind [Field=APPLY_AMT FileRef=5109 DataEl] DataEl=(5109,25, APPLY_AMT,EXEC_KO_MONEY,1,0,2,68,4,2) Bind [Field=ALL FileRef=5109 DataEl] DataEl=(5109,26, ALL,EXEC_KO_ALPHA,3,0,2,0,72,0) Bind [Field=ITEM FileRef=5109 DataEl] DataEl=(5109,27, ITEM,STRUCT1,3,0,1,240,25200,2) Bind [FileRef=5109 Structure=2] StructEl=(5109,2,27,72,350,240) Bind [Field=DEF_AP_CHECK_PRINT FileRef=5109 DataEl] DataEl=(5109,28, DEF _AP_CHECK_PRINT,STRUCTO,3,0,0,0,25440,2) Bind [FileRef=5109 Structure=1] StructEl=(5109,1,28,25440,0,0) Bind [Field=VENDOR_REF FileRef=5110 DataEl] Procedural Language (Flow of Control) In addition to the above data structures, flow of program control requires the following dimensions and bindings: Level--a dimension for the nested level of Begin/End constructs. Step--a dimension for the program statements in each procedure. Label--a dimension for arbitrary labels Bindings to provide flow are thus: [Proc, Level, Step, NId=NextStep]=step Goto: [Proc, Level, Step, NId=NextStep]=step while a conditional branch evaluates to a Level and inserts this Level into the Context Set, CS. Procedure entry and exit is similarly a manipulation of the Context such that on entry to a procedure, the Proc, Frame, Level, and Step are placed in CS, while the old CS is placed into a new CS. Return from a procedure is simply then, the restoration of the old CS. Example of a Recursive Function (Within Evaluator) Set Echo Bind [Factorial Int:{all}] Mult(Int:{Binding}[Factorial.vertline.Minus(Int:{Binding} Int:1)]) Bind [Factorial Int:1] Int:1 =[Factorial Int:5] INT(12):120 Object Oriented Program Example Dim Host Dict Dim OpMode Dict Bind 5 Dim Method Dict Bind 5 Dim Keyword Dict Bind 5 Bind [DCL DataType:NewAddress] Alpha:"Alpha:50" Bind [DataType DataType:newAddress] DataType:AdrField Bind [Host:DecAlpha DCL DataType:UDate] Alpha:"int64" ! Set up "Inheritance" Bind [OpMode=OOPS NId={All} DataType:{All}] [NId={Binding}[DataType DataType:{Binding}]] Bind [OpMode=OOPS NId={All} Keyword:{All}] [NId={Binding} [DataType Keyword:{Binding}]] ! Set Up "Polymorphism" Bind [Method=Format Keyword={All}] [Displayer Keyword={Binding}] Context Push OOPS Context Add OpMode=OOPS ! mDefine Two "Instances" Bind [Keyword=MinDays Desc] Alpha="Minimum Days to Age" Bind [Keyword=MinDays DataType] DataType:Integer Bind [Keyword=MinDays Desc] Alpha="Date of Aging" Bind [Keyword=MinDays DataType] DataType:UDate ! Manipulate Objects =[Method=Format Keyword=MinDays] V3MODULE(16):ITX_NUM =[Method=Format Keyword=AgeDate] V#MODULE(20):ITX_DATE ={Dcl Keyword=AgeDate] ALPHA(12):INT Context Add Host:DecAlpha =[Dcl Keyword=AgeDate] ALPHA(16):"int64" Context Pop Time-based System Example Dim Time Time Dim Tran Time Unique Dim B Binding Bind [freddy time={now}] alpha="now is the time" Bind [TranID Tran={New}] int=123 Bind [TranId Tran={New}] int=2345 Bind [TranID Tran={New}] alpha-"ho ho ho" =[TranId] ALPHA(20):"ho ho ho" =[freddy] ALPHA(24):"now is the time" Eval Remove_Point(B={LastBind}) =[TranId] INT(12):2345 Bind [TranId Tran={New}] alpha="the next one" =[TranId] ALPHA(24):"the next one" Bind [Next Int={All}] [IntMod=Next_IsctVal Int={Binding}] Bind [Describe Iter=[Next Int={Binding}],[IntMod=Echo Iter={Context}].vertline. [IntMod=MakeSeq_IsctVal@[TranId] Int=1 Int=2 Int=3] Eval [Describe] 2345 123 Reference: Operators for Manipulation of Data and Structures
itx_Point - Converting from V4 Point to Text
Syntax
itx_point(point, buffer, flags)
point a v4 point (V4Point)
buffer the text string/buffer to be updated (alpha)
flags any combination of standard itx flags (int)
Description
This module is used to convert a point from its internal representation
(as a pointer)
to a printable format.
Example
dcl v4point pt,*res;
loop
{xti_Point(tty_Get(`Eval?`),pt,0);res := v4_EvalPoint(pt);
if sys_address(res) then
{itx_Point(res;buf;0);p`The result is`,buf;};
};
/undefined_module/ - Auto-Loading Undefined Module
Syntax
v3_Set_Parameter(/undefined_module/, string)
string a V4 intersection to be evaluated whenever an
undefined module is referenced. The string
may contain one or more asterisks which are
replaced with the actual module to be defined.
(alpha)
Description
This format of the "v3_Set_Parameter" module is used to define a V4
intersection
"mask" which is to be expanded and evaluated whenever an undefined V3
module is
referenced.
Example
The example below causes V4 to substitute in the undefined module where
the
asterisk is, evaluate the resulting intersection and load the resulting
module
reference.
v3_Set_Parameter(/undefined_module/,"[* Dim:Macro]");
v4_AreaClose - Closing a V4 Area
Syntax
v4_AreaClose(areaid)
areaid the numeric area id to be closed (int)
Description
The "v4_AreaClose" module is used to close a V4 area that has been
previously
opened with the call "v4_AreaOpen". The area is closed and all
references to the area
are removed from the current context.
Note that all areas are closed upon V3/V4 exit.
Example
id := v4_AreaOpen(`clientstuff`,nil);
. . .
v4_AreaClose(id);
v4_AreaOpen - Opening a V4 Area
Syntax
areaid = v4_AreaOpen(filename, nil)
filename the name of the file to be opened as a V4 area
(string)
nil "nil" indicates a default open to read-only (nil)
The form above opens an existing V4 area for read-only access. The form
below is a
more generalized version and may be used to open existing areas for
read/update and
also to create new areas.
areaid = v4_AreaOpen(filename, ahibuf)
filename the name of the file to be opened as a V4 area
(string)
ahibuf a reference to the structure v4_ahi which
contains information on the definition of an
area. (V4C_AreaHInfo)
The format below is the most general form:
areaid = v4_AreaOpen(pcbbuf, ahibuf)
pcbbuf a reference to a v4_pcb structure which
contains detailed information for declaring a
new area file. (V4IS_ParControlBlk)
ahibuf a reference to the structure v4_ahi which
contains information on the definition of an
area. (V4C_AreaHInfo)
Description
The module, "v4_AreaOpen" is used to open a new or existing V4 area for
access by
the V4 multi-dimensional database. Several different modes of the call
are available:
Example
v4_AreaOpen(`v3_syslib:v4kernel`,nil); /* Open V4 kernel, read only */
v4_BigBufGet/v4_BigBufPut - Reading and Writing "Big Buffers"
Syntax
bytes = v4_BigBufGet(bufid, dstbuf)
bytes this module returns the number of bytes in
the big buffer (int)
bufid the buffer identifier/key (int)
dstbuf the v3 string buffer to be updated with the
"big buffer" (V4LEX_BigText)
writing a "big buffer" is done with the following module:
aid = v4_BigBufPut(bufid, srcbuf)
aid the area identifier indicating which area the
"big buffer" was put into. (int)
bufid the buffer id to store (int)
srcbuf the v3 buffer to be stored. (V4LEX_BigText)
Description
A "big buffer" is an entry within a V4 area which contains one or more
lines of text or
any other data.
Example
dcl struct V4LEX_BigText bt;
dcl sr text,sa;
v4_AreaOpen("v3lib",nil);
v4_BigBufGet("[V3_IOUNIT Dim:Macro]"),bt);
loop(text==bt.bigbuf;str_len(text);)
{sa == str_break(`.backslash.n`,text); p sa;};
v4_BindPoint - Returns the V4 Point Corresponding to the Last Binding
Syntax
point = v4_BindPoint(dimid)
point the point corresponding to the last binding
(v4point)
dimid a dimension of type Bind to be used for the
returned point (v4point)
Description
This module returns the point corresponding to the last binding made
within the
current V4 environment.
Example
v4_Bind(point,value);
bpoint := v4_BindPoint(v4_DimId(`Binding`));
v4_Bind - Binding an Intersection to a Value
Syntax
aid = v4_Bind(intersection, value)
aid the area id where the binding was stored (int)
intersection may be either a V4 point corresponding to an
intersection or a text string in the format of a
valid V4 intersection. (v4point/string)
value may be either a V4 point or a text string in
the format of a valid V4 point.
(v4point/string)
Description
The "v4_Bind" module is used to bind points in an intersection to a
value point. The
format of the call is:
Example
dcl v4point *isct,*val;
xti_Point(tty_Get(`Enter Isct?`),isct,0);
xti_Point(tty_Get(`and value?`),val,0);
v4_Bind(isct,val);
v4_Close - Closing a V4IS Area
Syntax
v4_Close(pcb)
pcb the V4IS area's parameter control block.
(V4IS_ParControlBlk)
Description
Closes the V4IS area specified in the pcb.
Example
pcb.FileName := `important.dat`;
pcb.OpenMode := xxx
v4_Open(pcb);
. . .
v4_Close(pcb);
v4_ContextAdd - Adding a Point to the Context
Adding a new point or replacing a point for a dimension already in the
context is done
with:
Syntax
v4_ContextAdd(frameid, point))
frameid the id of the frame to which the point is to be
added (use 0 for the current frame). (int)
point may be a V4 point or a text string
representing a point. (v4point/string)
Description
Adds the specified point to the current context for the specified
frame. In most cases,
the point is to be added to the current frame which is referenced via
frameid 0. If a
point already exists in the context with the same dimension then it is
replaced by the
new point.
Example
v4_ContextAdd(0,`Client:ABC`);
xti_Point(`Vendor:1233`,pt,0);
v4_ContextAdd(0,pt);
v4_ContextPop - Popping of a Context Frame
Syntax
v4_ContextPop(framenum)
framenum the framenumber to be popped off. Note that
all frames pushed after this framenumber will
also be popped. (int)
Description
This module pops off one or more frames from the current context. If
framenum is
given and nonzero then all frames up to the specified frame are popped.
Example
framenum := v4_ContextPush(`Level12`);
. . .
v4_ContexPop(framenum);
v4_ContextPush - Pushing a new Context Frame
Syntax
frameid = v4_ContextPush(framename)
frameid the unique frame number generated for this
context push. (int)
framename a text string naming this frame. Frame names
do not necessarily have to be unique. (string)
Description
This module pushes a new frame with a name of framename onto the
current V4
context. The frameid is returned and may be used in subsequent context
calls.
Example
framenum := v4_ContextPush(str_concat(Level),lvl+=1);
v4_DataElVal - Extracting a Value from a Buffer
Syntax
value = v4_DataELVal(buffer, des/despt)
value the resulting V3 value extracted from buffer
buffer usually a record buffer containing multiple
fields (alpha)
des a data element descriptor or point (v4point)
Description
This module is used to extract a value (i.e. field) from a buffer based
on the field's
data element structure.
v4_DimGet - Obtaining the Dimension ID
Syntax
dimid = v4_DimGet(dimname)
dimid = v4_DimGet(point)
dimid the dimension's numeric id (int)
dimname the text name of the dimension (string)
point the dimension id corresponding to any V4
point can also be obtained. (v4point)
Description
This module returns the dimension id associated with a dimension name
or returns
the dimension id for a specific point.
Example
xti_Point(tty_get("Enter Point?"),point,0);
dimid := v4_DimGet(point);
v4_DimMake - Creating a New Dimension
Syntax
The V4 Interpreter Macros The V4 interpreter has sophisticated macro definition and expansion capabilities. Macros can be locally defined and used, or stored within a V4 area for use in later environments. The primary purpose of a V4 macro is to provide a clean, easy-to-use method for defining a concept as multiple bindings. For example, referencing a data file (V4IS) through V4 requires several bindings to define the area name, the key(s) to the area, how substructures are to be defined, etc. These could be done explicitly as shown below for accessing a vendor database Bind [Filename FileRef=9999] Alpha=" . . . /nsd/apvenmas.dat" Bind [Buffer FileRef=9999 VendorPCB={All}] VendorPCB={Binding} Bind [Buffer FileRef=9999] Open_V4IS([FileName FileRef=9999] [FileRef=9999 Structure=1] VendorPCB=0) Bind [Record FileRef=9999 Vendor_Ref={All}] Get_V4IS([Buffer FileRef=9999] [DataEl FileRef=9999 [FileRef=9999 Key=1 Part=1]] Vendor_Ref={Binding} RecPtr=0) Bind [Record FileRef=9999 Vendor_Id={All}] Get_V4IS([Buffer FileRef=9999] [DataEl FileRef=9999 [FileRef=9999 Key=2 Part=1]] Vendor_Id={Binding} RecPtr=0) Bind [Value Field={All} Vendor_Ref={All}] Field_V4IS([Record FileRef=9999 Vendor_Ref={Binding}] [DataEl FileRef=9999 Field={Binding}]) Bind [Value Field=(All) Vendor_Id={All}] Field_V4IS([Record FileRef=9999 Vendor_Id={Binding}] [DataEl FileRef=9999 Field={Binding}]) Bind [Value Field={All} Vendor_Ref={All} Month={All}] S1bcField_V4IS([Record FileRef=9999 Vendor_Ref={Binding}] [DataEl FileRef=9999 Field={Binding}] [DataEl FileRef=9999 Field=Purch_Month] Month={Binding}) Bind [Value Field={All} Vendor_Ref={All} Index={All}] S1bxField_V4IS([Record FileRef=9999 Vendor_Ref={Binding}] [DataEl FileRef=9999 Field={Binding}] Index={Binding}) and repeated for every data base to be access. Or, a macro could be defined once and then invoked for each database {/ADCL(aFileRef, aFileName, aRefField, aIdField, aRepeatField, aRepeatIndex) Bind [Buffer FileRef:aFileRef AreaPCB={All}] AreaPCB={Binding}; Bind [Buffer FileRef:aFileRef] Open_V4IS(aFileName [FileRef:aFileRef Structure:1] AreaPCB:0); Bind [Record FileRef:aFileRef aRefField:{All}] Get_V4IS([Buffer FileRef:aFileRef] [DataEl FileRef:aFileRef [FileRef:aFileRef Key:1 Part:1]] aRefField* RecPtr:0); Bind [Value Field:{All} aRefField:{All}] Field_V4IS([Record FileRef:aFileRef aRefField*] [DataEl FileRef:aFileRef Field*]) ; if defined aIdField; Bind [Record FileRef:aFileRef aIdField:{All}] Get_V4IS([Buffer FileRef:aFileRef] [DataEl FileRef:aFileRef [FileRef:aFileRef Key:2 Part:1]] aIdField* RecPtr:0); Bind [Value Field:{All} aIdField:{All}] Field_V4IS([Record FileRef:aFileRef aIdField*] [DataEl FileRef:aFileRef Field*]); end; if defined aRepeatField; Bind [Value Field:{All} aRefField:{All} ARepeatField:{All}] S1bcField_V4IS([Record FileRef:aFileRef aRefField*] [DataEl FileRef:aFileRef Field*] [DataEl FileRef:aFileRef Field:aRepeatField] aRepeatField*); end; if defined aRepeatIndex; Bind [Value Field:{All} aRefField:{All} aRepeatIndex:{All}] S1bxField_V4IS([Record FileRef:aFileRef aRefField*] [DataEl FileRef:aFileRef Field*] aRepeatIndex*); end; }/ADCL ADCL(5203, "v3_sapsdat:apvenmas.dat", vendor_ref,IdField=vendor_id, RepeatIndex=Line) Note that defining additional areas only requires a single additional line in which all necessary parameters are easily defined. Defining a Macro A macro definition consists of a macro definition line, a body, and a macro trailer line. The macro header line declares the macro name and any parameters which may be referenced throughout the macro body. The body consists of any number of V4 interpretive commands plus several special commands which are only available within macros. The trailer is a line indicating the end of the macro. Macro Header Lines The format of a macro header line is {/macroname (param1, param2, . . . paramn) where macroname is the name of the macro, param1, . . . paramn, are the names of the parameters which may be referenced within the macro. It is desirable to preface each parameter with a single letter prefix, normally the letter "a". If all parameters are prefaced with the same letter then macro invocations can reference the parameters with or without the single letter prefix. Macro Body Lines The body of a macro is simply a list of V4 commands. In addition to the commands which actually do something are several commands for conditional execution such as "If" and "If1". All commands in the macro body must be ended with a semicolon! Macro Trailer Line The macro trailer line ends the macro. The format is }/macroname where macroname must match the name in the header line. Macro Invocation A macro is invoked using a syntax similar to that of a procedure call macroname(arg1, arg2, . . . ) macroname(paramname=arg, paramname=arg, . . . ) As shown above, two formats are possible. The first format simply lists the argument in the order in which they are defined in the macro header line. The second form permits the specification of parameter values by parameter name (with or without the single letter prefix). It is possible to mix and match the two formats. Arguments not explicitly assigned to a parameter are assigned to the "next" parameter. In practice it is a good idea to define macros with all mandatory arguments before optional arguments. Then in an invocation, the mandatory arguments can be given without parameter names and any optional arguments can be listed with names. Using Macros in a V4 Area See the Set MacroBind command for more information on saving macros in a V4 area and the Set MacroCall command for an explanation on how to reference them. Extracting the Contents of a Macro It is possible to extract the contents of a macro with the following macroname( )>file macroname( )>>file The first form copies the contents of the macro to the file. The second form appends the contents to the file. Commands Area--Opening/Creating a V4 Area Syntax Area Read filename filename . . . Area mode filename options
mode how the area is to be opened, Create to create a new
area, Read to read an existing area, Update to read
and/or update an existing area, CreateIf to create an
area if it does not already exist, and Close to close an
area.
filename the name of the area
options a list of options when creating a new area
Description The Area command creates, opens, and closes area in a V4 environment. One or more areas can be open for reading with a single command. The V4 kernel area should always be the first area opened and can be references as filename "v4kernel". A variety of options are available when creating a new area. These a summarized in the table below
Hierarchy number Assigns the area to a hierarchy. This is a
number from 1 to 7. The V4 kernel is always
number 1.
ExtDictUpd Allow external dictionary updates.
IntDictUpd Allow internal dictionary updates.
BindingUpd Allow binding updates.
Primary A primary area
Slave A slave area.
Categories list Categories are as listed
NoExtDictUpd Do not permit external dictionary updates
NoIntDictUpd Do not permit internal dictionary updates
NoBindingUpd Do not permit bindings
NewMacro macroname Specifies a macro to be invoked whenever the
area is created (for use with the CreateIf mode).
BucketSize bytes Specifies the bucket size of the area. The
total number of bindings permitted to a binding
point is indirectly related to the bucket size.
In most cases the default bucket size should
be acceptable.
Example Area Read v4kernel Area Create Demo Hierarchy 5 Primary Dimension--Declaring a New Dimension Syntax Dimension name type attributes
name the name of the dimension
type the dimension type or how the dimension is to be used
attributes a list of optional attributes
This command is used to define new dimensions in an area. A dimension type must be one of the type from the table below (a detailed description of each type follows)
Alpha A character string
BigText A large, multi-line chunk of text
Binding A V4 Binding
Compound A compound intersection used in iterations
Context A context point, expanded into components upon evaluation
DataEl A data element specification (the offset, length, datatype,
etc.)
Dictionary A dictionary point-stored as a number, displayed as a
keyword
Foreign A foreign data structure
Integer An integer number
Intersection An intersection
IntMod An internal module
List A list of values
Logical A logical (true/false) value
MemPtr A memory pointer
PIntMod A partial internal module
PointIndex A number representing a V4-allocated datastructure
Pragma A pragmatic point (usually invisible)
Shell A shell point, values are other points
Special Points specified with the "{xxx}" construct
StructEL A structure specification
Time A time or transaction point
V3Mod A link to a V3 module
V3PicMod A link to the PIC definition of a V3 module
V3ModRaw A link to a V3 module
Attributes may be also specified to further refine the declaration. These are summarized below
Acceptor module Defines a V3 acceptor module for the dimension.
AutoContext point Defines a V4 point to be used in auto-context look-
ups. See below for more information on this feature
Binding num Assigns a binding weight number to this dimension.
See below for more information.
Displayer module Defines a V3 displayer module for this dimension
Macro string Declares a macro string to be used when creating
points. Not currently used.
Multiple logical Allows multiple values to be specified as a single
point (ex: dim:a,b,c)
Range logical Allows a range of values to be specified as a single
point (ex: dim:a . . . b)
Unique Allows the user to create new points on this
dimension with the (new) construct.
Verify Not currently used
Internal Who knows
External Opposite of Internal
Dimension Who knows
Heirarchy n Specifies the Heirarchy for this dimension
Category xxx Not currently used
Review how Not currently used
Auto-Context The AutoContext attribute can be used to indirectly specify how a point is to be "valued" during the evaluation of an intersection if that point is not currently defined in the context. For example, if the Customer dimension has been defined as Dimension Customer Integer AutoContext NId:NeedCustomer and the following bindings have been made Binding [NeedCustomer Dim:Customer Order:{any}] [BilltoCus Order*] and if we are in the context of (Order:543210 Date: 4/15/93 Item:123) and attempt to match (through an evaluation) [ItemPrice Item:123 Date: 1/1/93 . . . 12/31/93 Customer:56781] then it would appear that no match can be made because we do not have any point in the Customer dimension in the current context. However, V4 will automatically attempt to evaluate [NeedCustomer Dim:Customer] and use the result as the value for the Customer dimension for this match. This would match the binding above, re-evaluate to determined the billto customer for the current order and if it equaled Customer:5678 permit the match to succeed. Binding Numbers Binding numbers are an important aspect of a large V4 environment. These numbers control bow a binding is to be stored. During a binding, V4 scans all points in the binding intersection from left to right and tracks the first dimension with the highest binding number. This becomes the dimension used as the primary "key" for storing the binding. For this reason, all dimensions with a binding number must be stored as a number--Integer, Dictionary, Time, etc. Alpha, foreign, data elements, etc. cannot have binding numbers. Append--Appending a Point to a List Syntax Append isct point isct an intersection evaluating to a list point the point to be appended Description This command appends the specified point to the list referenced by isct. The intersection must evaluate to a list point or an error is generated. Example Dim ModuleList List Bind [Module:xyz Package:pack1] ModuleList:( ) . . . Append [Module:xyz Package:pack1] Variable:foo Insert--Insert a Point to the Beginning of a List Syntax Insert isct value isct an intersection evaluating to a list point a point to be inserted at the beginning of the list Description This command inserts point at the beginning of a list pointed to by isct. Bind--Bind an Intersection to a Value Point Syntax Bind isct point isct an intersection point a point to bound as the value of the intersection Description The Bind command binds an intersection to a value point. Example Bind [OHQty Item:xyz Location:loc23] Quantity:999 Context Add--Adding a Point to the Context Syntax Context Add point point a point to be added to the current context Description The point is added to the current frame of the current context. If the point is an intersection then it is evaluated before being added to the context. Example Context Add [PreferredLocation Customer: 1234] Context Examine--Examining the Current Context Syntax Context Examine Description This command generates a list of all points currently active in the context to the user's console. Context Pop--Popping Frame(s) off of the Context Syntax Context Pop [name] name the frame name to pop off to Description This command pops of the current context frame or pops off multiple frames until a frame with name is popped. Context Push--Pushing a New Frame onto the Context Syntax Context Push name name The name of the frame Description This pushes a new frame onto the current context with the specified name. Points added to the context after the "push" are associated with the frame and are removed from the context when the context frame is popped off. Dump--Dumping all Intersections Containing a Given Dimension Syntax Dump dimension [filter] dimension the search dimension. A scan of all bindings in all current areas will be made for any intersection containing the specified dimension. filter an option filter intersection. If given then only intersections containing all of the points in filter will be output. Description The Dump command is used to exhaustively search all bindings in all open areas for the current context. Any binding containing dimension will be listed. If a filter is specified then an intersection must not only contain dimension but must also have points matching all points in filter. Example The example below will search for all bindings containing the Date dimension and additionally containing the point "Company:CDF" and any IMRef points. Dump Dim:Date [Company:CDF IMRef:(all)] Evaluate--Evaluate an Intersection Syntax Evaluate intersection intersection an intersection to be evaluated Description This command evaluates the specified intersection. An error is generated if the intersection cannot be completely evaluated. Example The example below calculates the price for item #1234 as of Mar. 1, 1993 for the BillTo customer of the current order Eval [Price IMRef:1234 Date: 3/1/93 [BilltoCusRef Order*]] Exit--Exit from the V4 Interpreter Syntax Exit Description The "Exit" command closes all open areas and exits from the V4 interpreter. Include--Execute Commands from a File Syntax Include file file a file containing V4 interpreter commands to be executed Description This command redirects the command input to the specified file. All lines in the file will be executed as V4 commands, macro expansions or macro definitions. The "Include" command may be nested to any reasonable limit. =--Evaluate an Intersection Syntax =intersection intersection an intersection to be evaluated Description This command evaluates an intersection and outputs the resulting point to the user's console. Set Echo--Enables Echoing of Command Lines Syntax Set Echo ON Set Echo Off Set Echo n Set Echo ALL Description This command enables or disables the echoing of input lines to the V4 interpreter. The echo state of an Included file is one less then the state of the issuing the Include command. Setting the echo to ON enables echoing of the current level only. Setting the echo to ALL enables echoing for the current level and all nested levels. Setting the echo to a number n enables echoing for the current level and n-1 nested levels. Set Parameter--Set a Global Substitution Parameter Syntax Set Parameter letter value letter a letter from "A" to "Z" which denotes the parameter value any value to be associated with the parameter Description Global parameters may be set and reset at any time within a V4 interpretive session. A parameter may be referenced by enclosing it's name with braces. Example Set Parameter A Vendor Bind [Name {A}:123] Alpha:"Smith Supplies" Set Result--Enable/Disable Echo of Bindings Syntax Set Results ON Set Results OFF Description This Set option controls the outputting of binding information after each Bind command. Set Trace--Enable/Disable Evaluation Tracing Syntax Set Trace mode mode for different tracing modes. The current values are 0 to disable tracing, 1 for nominal tracing and 8 for fuller tracing. Description This command controls the handling of the trace facilities within the V4 intersection evaluator. Set MacroBind--Controlling the Placement of Macro Definitions in an Area Syntax Set MacroBind isctmask point isctmask in intersection mask that is used with the current macro name to form a complete intersection. point a point used to store the macro. This point is usually specified as "dimension:{new}" to ensure that the macro is written as a new point in the same area that the above intersection is stored. Description This option is used to control how macros are stored in a V4 area. The intersection mask, isctmask, should contain an asterisk "*" which is replaced with the name of the current macro. The point is evaluated and the integer value associated with the point is used as a unique key to store the macro in the "BigText" format. The intersection and value are bind'ed together and the binding area selected is also used to store the actual macro. Example Dim Macro Int Unique Set MacroBind [*Dim:Macro] Macro:{new} Set MacroCall--Determine the Access of a Macro Syntax Set MacroCall isctmask isctmask an intersection mask Description This command is used to control how macros are found by the V4 interpreter. In most cases, the intersection mask, isctmask, is identical to that of the Set MacroBind settings used to store the macros. Example Set MacroCall [*Dim:Macro] Set TextBind--Control the Saving of a BigText Buffer in an Area Set TextBind isctmask point isctmask in intersection mask that is used with the current macro name to form a complete intersection. point a point used to store the macro. This point is usually specified as "dimension:{new}" to ensure that the macro is written as a new point in the same area that the above intersection is stored. Description Example Set TextBind [Macro:{Context} Dim:Macro] [Macro:{New}]
Dimension Types
Alpha A character string
BigText A large, multi-line chunk of text
Binding A V4 Binding
Compound A compound intersection used in iterations
Context A context point, expanded into components upon evaluation
DataEl A data element specification (the offset, length, datatype,
etc.)
Dictionary A dictionary point-stored as a number, displayed as a
keyword
Foreign A foreign data structure
Integer An integer number
Intersection An intersection
IntMod An internal module
List A list of values
Logical A logical (true/false) value
MemPtr A memory pointer
PIntMod A partial internal module
PointIndex A number representing a V4-allocated datastructure
Pragma A pragmatic point (usually invisible)
Shell A shell point, values are other points
Special Points specified with the "{xxx}" construct
StructEL A structure specification
Time A time or transaction point
V3Mod A link to a V3 module
V3PicMod A link to the PIC definition of a V3 module
V3ModRaw A link to a V3 module
Alpha--Character String Usage Upper and lowercase alphanumerics usually enclosed in single or double quotes. If no quotes are specified then the keyword is converted to uppercase and stored. Storage Method Strings of up to 255 bytes are stored in contiguous bytes with the length of the string in the first byte. Example Dim ModuleName Alpha Bind [Name Module:1233] Alpha:"ConversionMod" Special Case The Alpha dimension is a defined within the V4 kernel. A quoted string not prefaced with a dimension name is assumed to be a point on the Alpha dimension. Alpha:"Now is the time" is the same as "Now is the time" BigText--Large Text Arrays Usage This dimension type is used to store large amounts of text (via the BigBuf format) as a V4 point. Storage Method The point itself is stored as an integer value and is used as a key to obtain the actual data. Binding--A Binding Point Usage Binding points cannot be explicitly referenced. These are internal points created whenever an intersection is bound to a value point. The last binding point created can be referenced via binddim::{Binding} Storage Method Bind points are stored as a special data structure
struct V4DPI_BindPointVal /* Format of Value for a
*/ Binding Point
{unsigned short Dim ; /* Dimension */
unsigned short BindId ; /* Binding Id in list */
int DimPntVal ; /* Point Value for binding list
(these first 3 fields used to form key) */
unsigned short AreaId ; /* AreaId of area containing
binding list */
} ;
Compound--Compound Intersections for Iterating Usage Storage Method Example ! How to sequence thru a sequential Text file Bind [Sequence FileName={ALL}] [IntMod=MakeSeq_TextFile FileName={BINDING}] Bind [Next Sequence=NextFile FileDesc={ALL}] [IntMod=Next_TextFile FileDesc={BINDING}] Bind [Loop SeqPnt={ALL}] Iter=[Next SeqPnt={BINDING}],[IntMod=Echo Iter={Context}] Bind [List FileName={ALL}] Iter=[Next SeqPnt={Binding}],[IntMod=Echo Iter={Context}] .vertline. [Sequence FileName={BINDING}] =[List FileName= Context--A Context Point Usage A context point is composed of a list of other points. When a context point is used as a component point of an intersection to be evaluated, each of its components are added to the context. Thus it is not explicitly a point to be matched. Storage Method Context points are stored as a any other V4 list. DataEl--A Data Element Usage (fileref, element, name, dimname, v3datatype, keynum, owner, offset, bytes, decimals)
fileref the file reference number
element the element number for this field
name the name of this field
dimname the dimension name (or V3 object name)
v3datatype the V3 datatype code (see /DT_xxx/)
keynum the key number if field is a key
owner the structure id owning this field
offset the offset within the owner structure
bytes the number of bytes for this field
decimals the number of decimal places implied in this field
The point is stored as a small datastructure containing the fields above in a packed format. Dictionary--A Dictionary Entry Usage A dictionary entry is a any keyword which is internally stored in a V4 dictionary and then treated as an integer number. This number is encoded with the area hierarchy and unique dictionary entry number so that dictionary entries can be correctly maintained in a multi-area V4 environment. Dictionary entries usually take up less space than alpha keywords but take longer to format on input and output because of the additional lookup required. Dictionary entries are most often used when a alpha field requires binding potential. Use of the dictionary permits the designer to reference points as keywords yet let V4 treat the points as integers. Storage Method Dictionary entries are four-byte integers. Foreign--Foreign Data accessed programmatically. Integer--Integer Numbers Usage Integer numbers are input and used as in any other language. Storage Method Currently V4 supports four-byte integers. Example Dim MonthofYear Integer Intersection--A V4 Intersection Usage An intersection is composed of a left bracket which begins the intersection one or more points an optional vertical line optional points after the vertical line a closing right bracket which ends the intersection An intersection cannot contain more than one point in any given dimension! Storage Method Intersections are stored in the value portion of a point. Since there is a maximum size of a point (which is determined when the V4 program is built) there is a limit to the complexity of an intersection. IntMod--V4 Internal Module Usage The IntMod dimension provides the designer with a variety of computational primitives directly within V4. An IntMod point is treated as a two valued intersection. The first value references the particular internal module. The second value is a list of points which are the arguments to the module. Since the second argument is a list there are no restrictions regarding duplication of dimension. The syntax for a IntMod has been defined to keep it similar to that of a procedural language modulename (arg1 arg2 . . . argn) List--A list of points Usage A list is simply a list of points enclosed in parentheses. There are no restrictions on the points within a list and points may be intersections or other lists. Logical--Logical True & False Usage This dimension type is used to store simple boolean True/False. Points may be specified by any of the following keyword True False Yes No Storage Method Point of this type are stored as integer zero or one. MemPtr--Memory Pointer Usage Memory pointers are used to reference specific memory locations. These are primarily for special V3 or V4 modules (such as the V4 IntMod handling V4IS). Memory pointers cannot be defined on input. On output they are displayed as hexadecimal values. Storage Method Memory pointers are stored as 32-bit or 64-bit pointers depending on the host platform. PIntMod--Partial Internal Module Usage The PIntMod dimension type is used Example Dim Real Int Dim Service Dict Bind [GasPrice] Real:105 Bind [GasPrice Type:Unleaded] [ ]Plus(Real:10) Bind [GasPrice Service:Full] [ ]Plus(Real:7) Bind [GasPrice Service:Full] [ ]Plus Real:7] PointIndex--Index to Internal Point Usage Points of this type are created by special V3 and V4 modules where extensive and possibly mysterious allocations and workings are required. One example is in the generation of sequences from lists. A V4 sequence must be a single point representing several points some of which may change with time. The PointIndex point type permits V4 to assign a unique id to a point and be able to link that point to an internal V4 datastrucuture which may change size/position with time. Storage Method Points of this type are stored as integers. However each active point of this type links up to a memory chunk which may be of considerable size. Pragma Usage This is an internal dimension type used for points needed by V4 to make certain things work. The normal user of V4 will not encounter this type of point. Storage Method There is no standard model for this point type. Shell--A Dummy Dimension for Holding another Point Usage This dimension type is a "dummy" dimension whose points are simply points on other dimensions. It is used primarily to differentiate multiple points which may share common dimensions in an intersection (remember that an intersection cannot contain more than one point in any given dimension). Storage Method This type simply stores another point as its value. Special--Special Points Usage All points with values of the "{xxx}" form are assigned the point type Special. V4 evaluates points of this type to actual V4 points at the appropriate time. Storage Method All special points are represented in the V4 point header area. StructEl--Structure Elements Usage This point type is used to represent V3 data structures (as opposed to the fields within a structure). The components of this point type are as follows (fileref, structnum, element, bytes, occurs, countfield, offset)
fileref the file reference number
structnum a unique structure number
element a unique element number
bytes the total number of bytes in one occurrence of this
structure
occurs the total number of times this structure occurs in
parent
countfield a reference to a count field (if one exists)
offset the starting offset in the parent structure
This point type is represented as a special V4 packed data structure. Time--Time/Transaction Ids Usage Points of this type represent time or transaction ids. Bindings containing these points are matched somewhat differently than other bindings. The difference is that if a dimension point is not explicitly in the context then it's "current" value is assumed and the point on that dimension which is closest to the "current" value, but not greater is matched. What this means is that if no specific context point is specified then the most recent point on that dimension is the favored point. This is basically how we handle time--if no specific time is mentioned then the current time is assumed and the last "statement" given is the one we are referring to. If a particular time is given (be it past or future) then that becomes the temporary reference point. Storage Method Time points are stored as integer values. Time points in a binding cause the calculation of the binding weight to be altered so that the most recent is always checked first. Example Dim Time Time Dim Tran Time Unique Bind [TranIld Tran={New}] int=123 Bind [TranId Tran={New}] int=2345 Bind [TranId Tran={New}] alpha="ho ho ho" =[TranId] Alpha:"ho ho ho" Dim B Binding =Remove_Point(B=(LastBind)) =[Tranld] Int:2345 V3Mod--Evaluation through a V3 Module Usage This point type allows V4 bindings to access V3 modules for any type of computations. The arguments to the V3 module are the additional dimension points in the call. The exact format is [v3mod:module Dim:result argpt argpt . . . ]
v3mod is a dimension of type V3Mod
module is the name of the V3 module to be called
result is the dimension of the returned value from V3. The V4
evaluator converts the V3 value into a format consistent
with this dimension
argpt arguments to be passed to the V3 module. These are
converted from V4 formats to V3 formats.
Storage Method These points are stored as character strings representing the V3 module. Example Bind [ItemPrice IMRef={ALL}] [V3Mod=CalcPrice Dim=Int [PriceType [PriceRule]] [Discount [PriceRule]] IMRef={BINDING}] /* CalcPrice--Dummy Module to Calcuate Item Price based on "rules" */ {/CalcPrice(rule,discount,imref) p return(123456); } V3PicMod--Link to V3 Module Code within V4 Area Usage This point type is used to represent V3 module "code" stored in PicMod (position independent code) format within a V4 area. Storage Method These points are integers where the value is used to create a key into a V4 area to access the module definition. V3ModRaw--Call to V3 Module Usage This point type is similar to the V3Mod point type in that it calls V3 modules. It differs in that no conversions are done between V3 and V4 datatypes. All arguments passed to V3 are as V4 points, and any result from V3 is expected to be a valid V4 point. Storage Method Points are stored as character strings corresponding to the V3 module name. Internal Modules Echo--Echoing Points to User's Console Syntax Echo (point point . . . ) pomt A point to be converted to text display format and output to the user's console. Description Evaluates all argument points and displays them on the user's console Eval--Executes a Command String Syntax Eval (stringpt) stringpt A character string point which is passed to the V4 command interpreter for evaluation. Description The stringpt is evaluated and the resulting string is passed to be V4 command evaluator. Example Eval(Alpha:"Include test") Next_TextFile--Obtaining the Next Line of a Text File Syntax alpha=Next_TextFile(filedesc) alpha The alpha value of corresponding to the next line in the sequence described by filedesc filedesc A descriptor describing the text file--previously generated by MakeSeq_TextFile Description This module returns as a point on the Alpha dimension, the next line in the text file described by filedesc. At end-of-file this module does not evaluate. Example Context Push MakeSeq_TextFile("file.txt")=Next_TextFile(seqpnt* ) MakeSeq_TextFile--Making a Sequence from a Text File Syntax seqpnt=MakeSeq_TextFile (filename) seqpnt A sequence point returned corresponding to the file filename A string referencing an existing text file. Description The filename point is evaluated and the resulting alpha string is treated as a file name. The file is opened by V4 and a sequence point is created from the open file. ListPoint_GetEl--Obtaining a Specific Point in List Syntax point=ListPoint_GetEl (list index) point The point corresponding to the index.sup.th element in list list a list of points index the element number in the list to return (1 is the first, 2 for the second, etc.) Description Returns the index point in list. Example =ListPoint GetEl(List:(`now` `is` `the`) int:2) Alpha:`is` ListPointSize--Obtaining the Number of Points in a List Syntax size=ListPointSize (listpoint dimpoint) point The point corresponding to the index.sup.th element in list list a list of points index the element number in the list to return (1 is the first, 2 for the second, etc.) Description Returns the size of the listpoint as a point on dimpoint. Next_ListPoint--Getting the Next Point in a Sequence Syntax point=Next_ListPoint (seqlist index seqpnt) point The point corresponding to the index.sup.th element in list seqlist a sequence list index the element number in the list to return (1 is the first, 2 for the second, etc.) seqpnt the sequence point Description Returns the next point in the sequence. FastNext_ListPoint--Getting the Next Point in a Sequence (Fast Version) Syntax point=FastNext_ListPoint seqpnt point The point corresponding to the index.sup.th element in list seqpnt a sequence point Description Returns the next point in the sequence without going through all of the nonsense of Next_ListPoint. MakeSeq_ListPoint--Making a Sequence from a List Syntax seqpnt=MakeSeq_ListPoint (list) point The point corresponding to the index.sup.th element in list list a list of points to be converted to a sequence Description Creates a new sequence from list and returns a new sequence point which may be used to sequence through the list. Skip_ListPoint--Skipping Points in a Sequence Syntax point=Skip_ListPoint (seqlist skipnum seqpnt) point The point corresponding to the index.sup.th element in list seqlist a sequence list skipnu | ||||||
