AggRef - An Aggregate Reference

Dimension Declaration

Dimension name AggRef

Value Syntax

Points can only be created with the dim:{new} or dim+ construct. Existing points can be referenced by entering dim:areaindex:index where areaindex is an index of a currently open aggregate area and index is an index into that area. A reference to a null-value for an area can be specified as dim:nullvalue where nullvalue is the language specific value for NONE (usually 'none' or 'null').

Description

This point type is primarily intended for dimensions used as "keys" to aggregates. Points on this dimension are stored as 32-bit integers.

Note: AggRef points can only be created if an Aggregate Area has been opened for update.

Examples

Example 13 - Parent/Child Aggregate Data

  Dim UOME AggRef
Table MidasUOM Macro MidasUOM
  Col Midas Alpha Ignore
  Col UOM *, Id UOMId, UOMType Int, Desc Alpha
EndTable
{/MidasUOM()
Point UOM UOM* ;
Context Add UOM* ; /* Add this UOM point to context for reference in children below */
Agg <UOM* #MidasUOM# > ;
}/MidasUOM
Loop #MidasUOM# Bind [UOM.. #c#] AggVal(UOM* Dim:#d# #i#)

Table MidasUOME Macro MidasUOME
  Col Midas Alpha Ignore
  Col Index Int, Factor Num, Suffix Alpha, Desc Alpha
EndTable
{/MidasUOME()
Agg <UOME+ #MidasUOME# UOM*> ; /* Link parent UOM* point to this new aggregate */
}/MidasUOME
Loop #MidasUOME# Bind [UOME.. #c#] AggVal(UOME* Dim:#d# #i#)
Bind [UOME.. UOM] AggVal(UOME* Dim:UOM #i+#)

Alpha - Alphanumeric Dimension Type

Dimension Declaration

Dimension name Alpha

Value Syntax

"alphastring"

where alphastring is any string of alpha-numeric characters.

^v"v4command"

where v4command is any V4 command to be immidiately interpreted.

^p"v4point"

where v4point is any V4 point specification to be immediately parsed and evaluated.

Alpha points may be just keywords, or enclosed in double quotes. The backslash may be used to insert special characters into a string. An alpha point is limited to just over 2000 characters. The BigText point type is better suited for long text strings although in most situations V4 will automatically determine the optimum point type for a given string.

Alpha strings may be continued over several lines by terminating a line-to-be-continued with a single '\' or '&'. A string may be broken into any number of lines. V4 does not automatically insert any additional white-space characters between continued lines.

If an Alpha dimension is declared with the Normalize option then all points on that dimension are converted to upper case.

It is good practice to use double quotes to enclose V4 strings. Strings enclosed in single quotes are treated as parser recognized patterns.

The table below lists the supported escape sequences-

Table 4 - String Literal Escape Characters

\n Newline character        \r Carriage return
\$ Escape        \' Nested quote
\b Bell        \\ Nested quote
\\ Single backslash        \A - \Z Control characters
\< Backspace        \nnn decimal equivalent
\f Formfeed        \xx two digit hexadecimal equivalent
\t Tab        \unnnn the four digit U+nnnn Unicode value (hexadecimal)
\l Linefeed       

V4 processes all alphanumeric strings using the 16 bit Unicode format. An Alpha point may be represented as either an 8-bit ASCII character string or a 16-bit Unicode string. The internal representation is hidden from the user. Input files to V4 may be ASCII, UTF-8, or either of the UTF-16 (big/little endian) encodings. Output from V4 is usually UTF-8 but may be overridden with options within the Output module.

The only time 8 versus 16 bits must be explicitly declared is when writing aggregates. Strings within aggregates must be explicitly declared to be 8 bit (Alpha) or 16 bit (Unicode).

Description

The Alpha dimension type is used for all alpha-numeric points. Points are stored as a string of 8 or 16 bit bytes. Comparisons are based on both content and length. Upper and lower case text is supported and considered different for matching.

Examples

  Alpha:keyword converts to Alpha:"KEYWORD"
  "Now is\tthe time for all good men" converts to Alpha:"Now is " Param:tab " the time for all good men"

BigText - Large Alphanumeric Strings

Dimension Declaration

Dimension name BigText

Value Syntax

string

where string is a string literal

<name attributes...>text </name>

where name is an arbitrary name with the only restriction being that the string '</name> does not appear in the text.

BigText text can span multiple lines so a beginning and ending delimiter is necessary. V4 uses a psuedo-XML format (<tag>...</tag>) to describe and delimit BigText points.

BigText strings may also be input as simple quoted text strings.

The explicit coercion of a BigText point to a list results in a list of Dim:Alpha points corresponding to each line within the BigText point.

If the dimension is to be used to pass JSON expressions from the web (via Context ADV) then the JSON attribute should be specified. In this case V4 parses the JSON expression as part of the input processing. The literal JSON expression (i.e. string) is not saved, only the internal parsed expression.

Table 5 - BigText Attributes

NewLine Values are NONE, INPUT, and NL
Comment="x" "x" is any character when appearing in the first column is considered a comment line
EmptyLine=keyword keyword is either KEEP to keep empty lines in the text, or IGNORE to ignore empty lines.
Indent=mode mode is IGNORE to ignore indentation, BLANK to treat all whitespace indentation
as a single space, INPUT to maintain indentation, and TAB to convert all indentation
to a single tab.
Javascript Treat the text as javascript source code and process with following rules: ignore leading spaces, ignore any text including and after '//' (comments), ignore spaces before semicolons, braces and equal signs, if the last character in a line is a semicolon then join the next line with the current.
Dimension=dim dim is the name of the dimension for the BigText point. The default is Dim:BigText.

Description

The BigText dimension type is used for incorporating large amounts of text into a V4 point. A V4 Alpha point is limited to slightly over 2000 characters. The maximum length of a BigText point is about 32,000 characters.

Examples

  Dim BT BigText declare a BigText dimension
  List:=BT:"now is the time for all good" ("now is" "the time for" "all good")
  Dim HText BigText Local Attribute "bt newline=none indent=blank"
[JS:ValidateSignOnForm Code] HText:<bt>
function ValidateSignOnForm(form)
{ if (form.Password.value.length == 0) { alert("Please enter password") ; return(false) ; }
  if (form.UserName.value.length == 0) { alert("Please enter user name") ; return(false) ; }
  return(true) ;
}
</bt>

Binary - Binary Data Dimension Type

Dimension Declaration

Dimension name Binary

Value Syntax

xxxx...

where xxxx consists of up to 254 pairs of hexadecimal digits, each pair representing an 8-bit byte.

Description

Binary data points are currently only supported through V4 Table entries and are limited to a maximum of 254 bytes. Binary entries are automatically assumed to be entered as hexadecimal digits with two hex digits per byte.

Examples

Calendar - General Calendar - Time Values

Dimension Declaration

Dimension name Calendar

Value Syntax

date

a date of the form yyyymmdd or mm/dd/yyyy or dd-mmm-yyyy where yyyy is the year, mm is the month, and dd is the day. Note that a four digit year MUST always be specified as two digit (or negative) years are valid. The mm portion of the date should be the week number when using the ISO calendar format.

datetime

a date and time where the date portion is as described above, followed by a colon or space and then a time of the form hh:mm:ss zone where hh is the hour (0-23), mm is the minutes (0-59) and ss is the optional seconds (0-59). The zone is an optional time zone specification. This may be an integer in the range of -12 to +12 with 0 being UTC (GMT, Zulu) time. A (3) letter abbreviation my also be given. The acceptable abbreviations are defined in the V4LanguageInfo.v4i initialization file.

#nnnn

where nnnn is the internal number of days offset from the base date (1 = 1-Jan-0001).

{now}

always refers to the current date + time

none

Refers to no date. The keyword none is the language specific value given in v4_home:V4LanguageInfo.v4i.

Description

A Calendar point may represent either a calendar date or a specific date and time. This point type differs from the Uxxx family of point types in that it is not limited to dates in the rage of 1850 through 2999. The Calendar point may specify any date from -10000 through 10000. The Calendar point type also supports several calendars in addition to the Gregorian. Currently, V4 supports the Gregorian, Julian, ISO, Islamic, and Hebrew calendars.

A Calendar point may represent a specific date or a date time. When a time is given it is converted to GMT (Greenwich Mean Time). A date-time may display as more than one date depending on the time zone of entry versus the time zone of display. For example the eastern standard time of 10-Mar-2003:20:00 would be stored as 11-Mar-2003:01:00 GMT.

The YMDOrder option may be given to specify the ordering of year, month, and day within a date value.

Calendar point types are stored as 64 bit double precision floating point. The integral portion represents the date and the fractional part is the time of day (0.5 being noon GMT).

The Calendar and TimeZone attributes may be given when declaring a Calendar dimension to declare the Calendar type and default time zone. If the time zone is not specified then the local time zone is assumed.

Since calendar points are stored as GMT time, both a timezone and daylight-savings flag are required to convert from UDate and UTime points.

Calendar points can resolve time to the second and the difference between two calendar points represents the fractional number of days between the two points which can be converted to seconds by multiplying by (60*60*24). Note however that the current implementation does not support the notion of UTC leap seconds so that the determination of time differences across multiple years may be off by several seconds (on the order of 0.8 seconds per year of difference).

Examples

  Dim Cal Calendar Defines a Gregorian calendar in local time zone
  Dim HCal Calendar Calendar Hebrew Defines a Hebrew calendar in local time zone
  Dim ICal Calendar Calendar Islamic TimeZone 3 Defines Islamic calendar in time zone 3 hours ahead of GMT
  Dim ISO Calendar Calendar ISO Defines an ISO calendar
  = Cal:{now} Returns, for instance, 2003-Mar-10:11:24:03
  = Cal:7-Mar-2003:22:17 Returns Cal:7-Mar-2003 12:00:00
  = Cal:"7-Mar-2003 22:17 GMT" Returns Cal:7-Mar-2003 17:17:00 in EST time zone. (note that quotes are needed if spaces are used as delimiters)
  = HCal:=Cal:20030101 Returns HCal:27-Tevet-5763
  = ICal:=Cal:20030101 Returns ICal:27-Shawwal-1423
  = ISO:=Cal:20030101 Returns ISO:2003-W01-3

CodedRange - A Coded Range of Integer Values

Dimension Declaration

Dimension name CodedRange

Value Syntax

See the Integer dimension point type.

Description

The CodedRange point type is parsed, represented, and handled in the same way as the Integer point type. The only difference is within the In module. It is used when a single number or point represents a range of points.

A mapping from each source point to the range of points must be made with the V4 module. The mapping can be done explicitly or implicitly via a binding of the form '[UV4:CodedRange Dim:dimension]=range-specification.

Examples

  Dim ProgId Coded Multiple Range

Bind [UV4:CodedRange Dim:ProgId]
V4(Dim:ProgId Number::200200 Range::200201..200209 Number::200220 Range::200221..200222)

  In(ProgId:200204 ProgId:200200) returns Logical:True because ProgId:200204 is in the allowed range of ProgId:200200

Color - Named Color Dimension

Dimension Declaration

Dimension name Color

Value Syntax

htmlcolor

where htmlcolor is a valid HTML color.

#rrggbb

where rrggbb is a 24-bit color specification.

none

Refers to no color. The keyword none is the language specific value given in v4_home:V4LanguageInfo.v4i.

other

A special keyword that has previously been assigned to this point type with the V4(Name::keyword) module.

Description

The Color point type is used to reference standard HTML/World-Wide-Web colors. All of the standard color names are supported and mapped to their corresponding 24 bit values. V4 Color points are stored as 32 bit integers. A color point can be projected onto an integer point to determine its numeric value.

Examples

  Dim C Color
  Sort(C.. By::Str(C* UC?) Do::EchoT(C* Format(int:=C* Mask::"xxxx"))) Outputs all colors and corresponding 24 bit value in hex format

Example 14 - Generate HTML Page Showing All Colors

  Include v4
Dim C Color

[Colors]
 Do(XML::html Echo() XML::body XML::"table border='0'"
    Enum(C..
     @Do(XML::tr Echo(XML::td C*)
         Echo(XML::Str("td width='50' bgcolor='#" Format(Int:=C* Mask::"xxxxxx") "'") "")
         Echo(XML::"td" Format(Int:=C* Mask::"xxxxxx"))
        )))

Complex - Complex Numbers

Dimension Declaration

Dimension name Complex

Value Syntax

(real imag)

where real is the real number component and imag is the imaginary component.

Description

The complex dimension type is used to represent complex numbers, i.e. numbers consisting of a real and imaginary component. Complex numbers are stored as a pair of double precision real numbers.

A complex point can be broken into its real and imaginary parts by explicitly coercing it to a list.

V4 only supports a limited number of operations on complex numbers.

Examples

  Dim C Complex
  Sqrt(C:(123 223)) results in C:(13.741767326399 8.11394905412201)
  Mult(Sqrt(C:(123 223)) Sqrt(C:(123 223))) results in C:(123 223)
  List:=C:(123 456) results in (Num:123 Num:456)

Country - A Country

Dimension Declaration

Dimension name Country

Value Syntax

#num

A numeric country code.

uncode

A three letter UN abbreviation for the country.

none

Refers to no country. The keyword none is the language specific value given in v4_home:V4LanguageInfo.v4i.

Description

This point type is used to represent all of the countries as defined by the file v4_Home:V4CountryInfo.v4i. This file is loaded when V4 starts up and each row of the file corresponds to a country. The various columns in the file define attributes of the country such as how telephone numbers and dates are handled. The default calendar and language of each country are also defined.

A country point explicitly coerced into a list results in a list of the attributes for that country. The format of the list is: (UNCountryCode abbreviation name intldialcode areacodeprefix intlprefix domesticprefix intltelemask domtelemask datemask calendar language numinfo).

Examples

  Dim C Country Defines a country dimension (Dim:UCountry is defined within v4_Home:v4kernel.v4i)
  List:=C:USA (Int:840 "USA" "United States of America" Int:1 Int:11 Int:1 "+c-aaa-nnn-nnnn" "(aaa)nnn-nnnn" "0d-mmm-0y" Int:0 Int:0 "$,.")
  Enum(C.. @EchoT(List(List:=C* Nth::Int*)/Num(1 to::ListSize(List:=C*)))) Lists all attributes of all countries
  Enum(C.. @EchoT(Int:=C* C* List(List:=C* Nth::3))) Lists the numeric code, abbreviation, and full name of all countries."

DataEL - Data Element Dimension Type

Dimension Declaration

Dimension name DataEL

Value Syntax

(fileref,element,v3datatype,keynum,owner,offset,bytes,decimals)

where fileref is the file reference number,element is the element number for this field,v3datatype is the V3 datatype code, keynum is the key number if field is a key, owner is the structure id owning this field, offset is the offset within the owner structure, bytes is the number of bytes for this field, decimals is the number of decimal places implied in this field.

Description

This datatype is used to describe fields within data records. Points on this dimension are made of the various components described in the table below. If a data record has repeating substructures then points of this dimension are used with points on a StrucEl dimension to completely map a data element to an offset within a record. In most cases these points are automatically created by an external database system or language compiler.

Examples

The V3 structure shown below generates the macro calls immediately following.

Example 15 - V3 Structure to V4 Macros

  dcl struct def__Test=5601,Field,"Application=MIDAS" {
int<dt__ref,key1> TestRef "This is keyed ref for the record" ;
alpha 20<dt__alpha> AlphaData ;
struct Sub[20] {
int<dt__integer> Sub1,Sub2,Sub3 ;
} ;
bitmap 1024<dt__bitmap> TestMap "Bitmap of entries found" ;
} ;

STRUCT( 5601, DEF__TEST )
FLD( TESTREF, 5601,1,DT__REF,1,1,1,0,4,0, "This is keyed ref for the record")
FLDK( 5601, 1, 1, TESTREF)
FLD( ALPHADATA, 5601,2,DT__ALPHA,3,0,1,4,20,0, "")
FLD( SUB1, 5601,3,DT__INTEGER,1,0,2,0,4,0, "")
FLD( SUB2, 5601,4,DT__INTEGER,1,0,2,4,4,0, "")
FLD( SUB3, 5601,5,DT__INTEGER,1,0,2,8,4,0, "")
FLD( SUB, 5601,6,STRUCT1,3,0,1,24,240,0, "")
FLDS( 5601,2,6,12,20,"",24)
FLD( TESTMAP, 5601,7,DT__BITMAP,3,0,1,264,132,0, "Bitmap of entries found")
FLD( DEF__TEST, 5601,8,STRUCT0,3,0,0,0,396,0, "")
FLDS( 5601,1,8,396,0,"",0)

A macro definition such as this one following can be used to interpret the compiler output.

Example 16 - V4 Macro to Define V3 Structure

  {/FLD( aField, aFileRef, aSeq, aObject, aV3DT, aKNum, aOwner, aBytes, aOffset, aDecimals, aComments )
. . .
Bind [DataEL Field:aField] DataEL:( aFileRef, aV3DT, aKNum, aOwner, aOffset, aBytes, aDecimals) ;
...
}/FLD

DateTime - Date + Time Dimension Type

Points on dimensions of this type incorporate a date and a time component with a resolution of one second. Internally, date-times are represented as the number of seconds since Jan 1, 1980. The DTInfo module can be used to extract the date and time components out of a point.

The YMDOrder option may be given to specify the ordering of year, month, and day within a date value.

Dimension Declaration

Dimension name DateTime

Value Syntax

[yy]yymmdd[:hh:mm[:ss]]

where yyyy is the year, mm is the month, dd is the day, hh is the hour, mm is the minute, and ss is the second. (Note: see the YMDOrder attribute)

[yy]yymmdd[:hh:mm[:ss]]

alternate

mm/dd/[yy]yy[:hh:mm[:ss]]

alternate

relday:hh:mm[:ss]]

where relday is 'Yesterday', 'Today', or 'Tomorrow'. (See v4_home:V4LanguageInfo.v4i for language specific values.)

relday

where relday is 'Yesterday', 'Today', or 'Tomorrow'. This specification corresponds to the 24 hour period, not a specific date-time.

Now

refers to the current date and time.

+numHours

refers to a date-time that is num hours from current. (See v4_home:V4LanguageInfo.v4i for language specific values.)

+numMinutes

refers to a date-time that is num minutes from current.

+numSeconds

refers to a date-time that is num seconds from current.

-numHours

refers to a date-time that is num hours before current. (See v4_home:V4LanguageInfo.v4i for language specific values.)

-numMinutes

refers to a date-time that is num minutes before current.

-numSeconds

refers to a date-time that is num seconds before current.

#num

where num is an integer number of seconds from 1-Jan-1980.

none

Refers to no date-time. The keyword none is the language specific value given in v4_home:V4LanguageInfo.v4i.

other

A special keyword that has previously been assigned to this point type with the V4(Name::keyword) module.

{now}

always refers to the current date-time. Unlike all date-times above, this reference is dynamic and is calculated as the current date-time whenever referenced. All other specifications are static and determined when parsed.

Description

A DateTime point represents a particular date and time. Unlike the Calendar point, datetime points are by definition local time. If it is necessary to represent true world time then use the Calendar point type.

DateTime points span a limited period of time- from January 1, 1980 through December 31, 2047.

Examples

  Dim UDT DateTime declare a date-time dimension
  UDT:951205:11:23:01 represents 5-Dec-1995 11:23:01
  UDT:#502629781 equivalent representation
  UDT:20010101 represents midnight 1-January-2001

Delta - A Delta Integer Value

Delta values are integers indicating a plus/minus offset, not a specific value.

Dimension Declaration

Dimension name Delta

Value Syntax

[+][-]num

Where num is an integer number prefaced by either a plus or minus.

Description

Delta values must be prefaced with either a plus or minus sign.

Examples

  Dim Delta Delta
  Bind [NextYear UDate..] DTInfo(UDate* Year::D:+1) returns the date plus 1 year

Dictionary - Dictionary Entry Dimension Type

Dimension Declaration

Dimension name Dictionary

Value Syntax

All points of this type are specified as keywords, converted to upper case. Numerics are also allowed as well as strings of numbers and alpha (e.g. 32BIT).

Description

V4 supports an internal dictionary that maps keywords to internal numeric values. This is used to both cut down on storage requirements and to speed up matching (matching two integer values is much faster and easier than testing two string values). The default NId dimension is of type Dictionary, as well as the Dim dimension (the dimension of all dimensions!).

The user has no control over the mapping of particular keywords to particular integer values and there is no guarentee that the mapping will remain constant over repeated 'compilations' of V4 bindings. If long term data is to be stored as dictionary entries then the External dimension type should be used.

Examples

  [V4Type Dim:Alpha]

External - An External Dictionary Entry

Dimension Declaration

Dimension name External

Value Syntax

name

where name is the external dictionary name. Any letters or digits may be used.

#num

where num is the internal number for an entry (an integer greater than 0).

#hash

where hash is any text string to be forced to an entry. These values are not saved in the dictionary and may only be used locally.

See also the Dictionary point type.

Description

This point type is similar to the Dictionary point type in that it maps a character keyword to a 32 bit integer number. However External dictionary entries are stored in an explicitly declared external dictionary area. Points may only be created on an external dimension if the area associated with the dictionary has been opened with update access.

V4 maintains the mapping from dimension to dictionary entry for all external dimensions. The dim.. construct may be used to reference all points on an external dimension.

External dictionary entries are normally case insensitive. Use the Dimension CaseSensitive option for case sensitive entires.

Examples

  Enum(State.. @EchoT(State*)) Outputs a list of all entries in the External dimension State.

Fixed - A Fixed Decimal 64bit Number

Dimension Declaration

Dimension name Fixed

Value Syntax

The syntax of a fixed number is simply nnnn.decimals.

Description

Fixed decimal numbers offer up to 19 significant digits with up to 8 decimal places. It is primarily intended for monetary values. Note that the 'Decimals' option must be given when declaring a dimension of type Fixed.

Examples

  Dim Money Fixed Decimals 2
Bind [Sales Cus:123] Money:10024.55

GeoCoordinate - Latitude/Longitude/Altitude

Dimension Declaration

Dimension name GeoCoordinate

Value Syntax

(lat long [alt [tz]])

alt and long are latitude and longitude. alt is an optional altitude in meters, and tz is an optional time zone.

(tag:value...)

The alternate format for specifying a geocoordinate consists of a series of tagged values enclosed within parentheses. The valid tags follow below-

Lat:latitude

The latitude specified as a positive (north) or negative (south) number degrees. A suffix of 'N' or 'S' may be used instead of a leading sign. Degrees/minutes/seconds may be specified as degrees:minutes:seconds.

Lon:longitude

The longitude specified as a positive (east) or negative (west) number degrees. A suffix of 'E' or 'W' may be used instead of a leading sign. Degrees/minutes/seconds may be specified as degrees:minutes:seconds.

Alt:heightuom

The altitude given (height) given in the chosen units (uom), one of M (meters), KM (kilometers), MI or MILES (miles), FT or FEET (feet), YD or YARDS (yards), NM or NMI (nautical miles). The height specification can be negative indicating below sea level.

TZ:timezone

The timezone specified as an integer value between -12 and +12 or a valid timezone abbreviation (e.g. EST).

Dst:distance

A distance specification. This is in the same format as the Alt tag.

Spd:speeduom

A speed specification. This consists of a speed and a unit-of-measure suffix (uom)- one of MPH (miles per hour), KMH (kilometers per hour), KNOTS (knots), FPS (feet per second), MPS (meters per second).

DT:datetime

A date time that is a valid Calendar point value.

Az:azimuth

The azimuth bearing given as a number between -180 and +180 degrees.

El:elevation

The elevation bearing given as a number between -90 and +90 degrees.

none

Refers to no geocoordinate. The keyword none is the language specific value given in v4_home:V4LanguageInfo.v4i.

other

A special keyword that has previously been assigned to this point type with the V4(Name::keyword) module.

Description

A geocoordinate point represents a point in space. In its simple form it simply locates a point in a space around the earth. In its more complex (tagged) form, it can not only represent the position of an object but that object's speed, velocity (speed + direction) at a given point in time.

The Geo module performs manipulations and calculations on these points. The MakeP module can be used to construct GeoCoordinate values programatically. Projecting a GeoCoordinate point into a list returns that point's component values.

The Dst and Spd tags cannot be both used within a given geocoordinate value.

All of the tags and units-of-measure for these points are defined v4_home:V4LanguageInfo.v4i.

Examples

  Dim G Geo declare dimension G
  G:(35:20N 120:45W 1000 -5) 35 degress 20 minutes north, 120 degrees 45 minutes west, 1000 meters elevation, -5 hours from GMT"
  G:(35.333 -120.75 1000 -5) more or less identical to above
  Geo(G:(35:17:29N 120:39:17W) G:(46:36:03N 112:02:33W)) return the distance between the two coordinates
  List:=G:(35 20.0N 120 45.0W 1000 -5) (Int:0 Num:35.333333 Num:-120.75 Int:1000 Int:-5)
  List:=G:(Lat:40.2723 Lon:75:45:12W DT:18-Jul-2006 Alt:1000yd Spd:18knots Az:34.443) (Int:1 Num:40.2723 Num:-75.753333 Num:914.4 Int:0 Num:18 Int:5 Int:3 Int:4 Num:34.443 Num:999 UCal:18-Jul-2006)

IMArg - Reference to Prior Module Argument

Dimension Declaration

Dimension name IMArg

Value Syntax

argnum where argnum references a prior argument.

Description

This special point type is used to refer back to prior arguments within an internal module call. It is implemented solely for runtime efficiency.

Examples

  Dim Arg IMArg
  [Example] GE([ComplexEvaluation] 0 Arg:1 -1) Evaluates [ComplexEvaluation] and compares it to 0. If the result is greater than or equal to 0 then the first argument (Arg:1), or the result of the evaluation is returned, otherwise -1 is returned.

Care must be taken not to use this construct as a nested argument. It is only valid for the module level it is within. The following example will not work as expected.

  [BadExample] GE([ComplexEvaluation] 0 Minus(Arg:1) -1)

Int2 - Two 32bit Integer Dimension Type

Dimension Declaration

Dimension name Int2

Value Syntax

<integer1 integer2>

where integer1 and integer2 are integer numbers.

other

A special keyword that has previously been assigned to this point type with the V4(Name::keyword) module.

Description

The Int2 dimension type is used to map 2 32bit integers into a single point. The primary use of this point type is for creating very large number of bindings where each point is unique and a mapping into 32 bits is not sufficient.

The MakeP module may be used to construct Int2 points.

If an Int2 dimension is declared with the Normalize option then V4 ensures that the first 32bit integer is always the lesser of the two.

The explicit coercion of an Int2 point to a list results in a 2 point list consisting of the first integer and the second integer. The List module with the Nth tag can be used to extract the either of the two components of an Int2 point.

See also the Packx() modules (e.g. Pack1616) for alternative solutions to this problem.

Examples

  Dim Int2 Int2 Bind 5
Bind [Int2:< CUS* UMonth* > Sales] Int:1234546
  MakeP(Dim:Int2 123 456) results in Int2:<123 456>
  List(List:=Int2:<123 456> Nth::2) results in second part of the Int2 point- Int:456
  Dim I2 Int2 Normalize
  I2:<23444 123> is converted to I2:<123 23444>
  MakeP(Dim:I2 456 123) results in I2:<123 456>

Integer - 32bit Integer Dimension Type

Dimension Declaration

Dimension name Integer

Value Syntax

The standard syntax for integers is used. Alternative radix entry can be achieved by prefacing the number with "^B" for binary numbers, "^X" for hexadecimal numbers, "^O" for octal, and "N" for bits.

See the V4 section on None Values for the handling of Integer none values.

Description

Points of this type are standard 32 bit signed integer values.

Examples

All of the following examples refer to the same integer.

  Int:10 Ten as a decimal number
  Int:^b1010 Specified as a binary digit
  Int:^o12 Ten in octal
  Int:^xA Hexadecimal reprensentation of 10
  Int:^N(4,2) Ten specified as bits 4 and 2

Intersection - A V4 Intersection

Dimension Declaration

Dimension name Intersection

Value Syntax

An intersection is denoted as a left bracket followed by one or more points, no two of the same dimension, and terminated with a right bracket.

Description

Intersections are V4 points just like everything else in the V4 model.

Examples

IntMod - Internal Module

Dimension Declaration

Dimension name IntMod

Value Syntax

name([arglist])

where name is the name of the module and arglist is an optional list of argument points.

Description

IntMods are calls to V4's internal modules.

Examples

List - List of Points Dimension Type

Dimension Declaration

Dimension name List

Value Syntax

([point...])

a list consists of 0 or more points inclosed within parentheses.

Description

List points are simply lists of other points (including lists). V4 has many facilities for operating on lists and converting from points to lists.

A V4 list may contain points of any type but, by default, intersections and V4 modules may not be included in lists without giving the Intersection attribute when the list is declared. This is a security feature to prevent potentially dangerous 'code' from being injected into V4 from web applications.

V4 implements lists in a variety of ways depending on how the list is created and what it contains. Some lists are lazy in that the points on the list are not predefined, but determined as they are accessed. For instance, a list may consist of points determined by evaluating an intersection.

Inserting a list into the context does just that- inserts the list as a single dimension point. If all the points within a list are to be inserted then the list may be prefaced with a back-quote. This forces the V4 runtime to insert each element of the list into the context, each as a separate point.

If a list dimension is declared with the DotIndex attribute then entries within those list points may be easily accessed with the syntax- list.point which is converted by the V4 compiler to List(list* Nth::point).

One particularly efficient method of implementing a list is the bitmap. Bitmaps work well when all the elements of a list are points on the same dimension, and the total number of points on that dimension are known in advance. The user may force V4 to implement lists by associating an Entries dimension attribute when the list dimension is declared. All lists on the dimension will be implemented as bitmaps. Use of the Tally ListOf option will create bitmaps if the list dimension is also specified. Non-bitmap lists may be converted to bitmaps by projecting one list onto the target (bitmap) list dimension.

The coercion of other V4 point types into a list results in a breakdown of that point into its component parts. For example coercing a UDate point into a list results in a 3-tuple consisting of the year, month, and day of that date. The table below describes the various mappings into a list.

Table 6 - Point to List Coercions

Int2
Complex (real imaginary)
BigText a list of Alpha points corresponding to each line within the point.
GeoCoord (0 latitude longitude altitude timezone)
GeoCoord (1 latitude longitude altitude timezone distance distuom speeduom heightuom azimuth elevation datetime)
UPeriod (year period)
UMonth (year month)
UQuarter (year quarter)
UWeek (year week)
UDate (year month day)
DateTime (year month day hour minute second)
Calendar (year month day hour minute second)
Calendar (year month day) - if no time specified
UTime (hour minute second fractionalsecond)
XDB (xdbId recId)
Country (uncode abbreviation fullname internaldialcode domesticcode
internationalcode internationaltelephonemask domestictelephonemask
datemask calendarcode languagecode numericmask)
Telephone (internationaldialcode areacode number)

Examples

  (now is the time)
(This is a mixed list (1 2 3 Dim:Alpha) )

Logical - Logical Value Dimension Type

Dimension Declaration

Dimension name Logical

Value Syntax

logical

where logical is one of: TRUE, FALSE, YES, or NO.

Description

Points of the logical type are stored internally as 32 bit integers. A logical True is stored as 1, while a logical False is stored as 0. V4 will automatically convert any numerical point greater than zero to a True and any number less than or equal to 0 as False.

Examples

  Logical:Yes or Logical:True
Logical:No or Logical:False
Logical:1 or Logical:0
TRUE ("TRUE" in all uppercase is recognized as Logical:True)
FALSE ("FALSE" in all uppercase is recognized as Logical:False)

PointReference - Reference to a Static V4 Point

Dimension Declaration

Dimension name PointReference

Value Syntax

none

Points of this type reference other point types. PointReference points are created with the IntMod:MakeP module.

Description

A PointReference dimension contains points that reference a static V4 point. V4 is a functional, call-by-value type language and as such it is difficult to perform repeated operations on what would be considered a variable is any other language. In some situations this ability is desirable, especially for performance reasons. Therefore V4 provides limited support for variables with this point-type. Needless to say, this capability should be used sparingly as it defeats the functional/call-by-value nature of V4.

The PRUpd module may be used to update a PointReference point. Other modules implicitly update points. These include the Str module when the first argument is a point reference (see example below) and the List module when appending to a list.

Points of this type may be inserted into the context or bound to an intersection. When binding as a value make sure to evaluate the MakeP module or you will get unexpected results (see example below).

Examples

  Dim X PointReference Declare a PointReference dimension
  Context Add MakeP(Dim:X "Now is the time for all") Create a point on the X dimension and add to the context
  Str(X* Replace::" " Num? With::".") Returns "Now.is.the.time.for.all"
  Str(X*) Returns "Now.is.the.time.for.all" (Note that the Str() module actually updates the value of the X point.
  Context Add MakeP(Dim:X 0) Makes another point reference set to Int:0
  Enum(Int:1..100 @PRUpd(X* {X* + Int*})) Adds all the integers from 1 to 100 into X*
  X* Is a point reference to Int:5050
  Bind [Foo] MakeP(Dim:X 0) Binds [Foo] to MakeP(Dim:X 0)- each evaluation of [Foo] results in the evaluation of MakeP returning a new point reference.
  EBind [Foo] MakeP(Dim:X 0) Binds [Foo] to the evaluation of the MakeP. Later evaluations of [Foo] all return the same point reference!

Real - 64bit Floating Point Dimension Type

Dimension Declaration

Dimension name Real

Value Syntax

num[.dec][Eexp]

where num.dec is a floating point number followed by an optional 'E' and an positive or negative exponent of exp.

other

A special keyword that has previously been assigned to this point type with the V4(Name::keyword) module.

Description

Floating point points are declared with the Real dimension type. The Decimal num option may be given when declaring a floating point dimension. This will fix the display of points on that dimension to num decimal places, not the actual precision of the point.

Care must be taken when comparing two floating point numbers, especially for equality. V4 uses the IEEE floating point format. Not all decimal numbers can be exactly represented in this format. Two floating point numbers may appear to be equal but may actually differ after many displayed (or not displayed) decimal places.

See the V4 section on None Values for the handling of Real none values.

The V4 Epsilon parameter may be set to force V4 into changing the way it compares floating point values. If the Epsilon value is set to a non-zero number then any two floating point numbers that differ by less than that value will be considered equal. The default value for Epsilon is zero. The examples below demonstrate how Epsilon is used.

The V4 Epsilon parameter may be a list. In this case the first numeric value is the comparison value as explained above. The second numeric value is used whenever areal number is calculated. If set then any real result with an absolute value less than the second value will be set to 0.

Table 7 - Floating Point Comparisons

Eq(), EqK() and In() AbsValue(num1 - num2) <= epsilon
NE() AbsValue(num1 - num2) > epsilon
GE() num1 + epsilon >= num2
GT() num1 - epsilon > num2
LE() num1 - epsilon <= num2
LT() num1 + epsilon < num2
LEG() 0 if Eq(num1 num2) else -1 if num1 < num2 else +1

Examples

  Real:100.23
Real:0.6543E10
  {123.5 = (123.111 + 0.389)} false - due to inability to exactly represent decimal values
  V4(Epsilon::0.0000001) set the floating point comparison epsilon to a non zero value
  {123.5 = (123.111 + 0.389)} true - the two points are considered as equal (within epsilon)
  {99.0 - 98.9999} returns 0.00010000000000332
  V4(Epsilon::(0 0.001)) set the two limits
  {99.0 - 98.9999} now returns 0 because the result is less than 0.001

RegularExpression - A Regular Expression String

Dimension Declaration

Dimension name RegularExpression

Value Syntax

see links below

Description

A RegularExpression point is similar to a point on the Alpha dimension. When a point is defined it is parsed as a regular expression and stored in an internal format. Regular expression points can be used in several modules including Str.

Many excellent descriptions of regular expressions are available on the web. Try Wikipedia: Regular Expressions or Regular-Expressions.info for an overview of regular expressions.

Note that a regular expression normally attempts to match the longest pattern. This may be overridden by specifying a question mark ('?') after an asterisk ('*') or plus sign ('+'). See the examples below.

Examples

  RegExp:"^abc(.*)def" a pattern matching begin-of-string (^), "abc", any number of characters, then "def"
  Context Add "<input type='text'>Some random text<input type='checkbox'>" Add Alpha pont to context
  Str(Alpha* RegExp::"<(.*)>" Group::1) returns "input type='text'>Some random text<input type='checkbox'"
  Str(Alpha* RegExp::"<(.*?)>" Group::1) returns "input type='text"

Shell - Dummy "Shell" Dimension Type

Dimension Declaration

Dimension name Shell

Value Syntax

point

the value of a Shell point is any other V4 point.

Description

Shell dimensions do not have any particular format or syntax. Points of this type have values of other points. Hence a shell point is simply a dimension wrapped around a point of some other dimension. Shell points are used by many of the internal modules to denote a special action or operand.

Shell points can be inserted into the context and can be used as a common dimension for 'passing' a variety of points into a single intersection. The evaluation of shellpoint* returns the current value of that shell point. If that is an intersection, or special V4 value (such as dim* or dim:{now}

Examples

  Context Add Shell1:UDate:5/1/07 Add to context
  Context Add Shell2:UDate:{now} and again add to context
  Shell1* returns UDate:5/1/07
  Shell2* returns UDate:{now}
  `Shell2* returns UDate:7/1/07 (or whatever the current date is)
  Dim Anything Shell Declare the Shell dimension
  Anything:1 (Anything:Int:1)
  Anything:Sales (Anything:Nid:Sales)
  Anything:"The Title" (Anything:Alpha:"The Title")

SSVal - Special Spreadsheet Values

Dimension Declaration

Dimension name SSVal

Value Syntax

Currently there are only eight valid points on this dimension. The are-

Table 8 - SSVal Points - Allowed Values

Div0 Cell displays a division by zero error.
Empty Appears as a blank cell on a spreadsheet
NA Cell displays as 'not applicable'
Name Cell displays a name-error value.
Null Cell displays a null value
Num Cell displays a number error.
Ref Cell displays a reference error
Value Cell displays a value error.

Description

The SSVal dimension contains points that have special meaning or display properties on spreadsheets.

Examples

StructEl - Structure Element Dimension Type

Dimension Declaration

Dimension name StructEl

Value Syntax

(fileref,structnum,element,bytes,occurs,countfield,offset)

where fileref is the file reference number, structnum is a unique structure number,element is a unique element number, bytes is the total number of bytes in one occurrence of this structure, occurs is the total number of times this structure occurs in parent,countfield is a reference to a count field (if one exists), and offset is the starting offset in the parent structure.

Description

Structure element points are points that describe a data structure. In most cases they are automatically generated by a database system or a language compiler. See DataEl point types.

Examples

See the DataEL dimension type for more description and examples.

TagVal - Tagged Argument Value

Dimension Declaration

Dimension name TagVal

Value Syntax

name::point

where name is a valid tag name and point is the value point associated with the tag.

Description

V4 provides a the Tag dimension which is of type TagVal. All tagged argument points are points on this dimension. Tagged argument points can be created with the MakeP module.

Examples

  Sort(Tag.. By::Alpha* Do::EchoT(Alpha*)) lists all tags. Note that the points resulting from 'Tag..' are alpha tag names.
  MakeP(Tag:Pairs Logical:True) results in Pairs::Logical:True

TelephoneNumber - An International Standard Telephone Number (or Other Electronic Address)

Dimension Declaration

Dimension name TelephoneNumber

Value Syntax

[type:]+ccc(aaa)nnnn[xext]

where type is the type of phone: {HOME, CELL, WORK or FAX}, ccc is optional country code, aaa is the city/areacode, nnnn is the number and ext is an optional extension.

aaannnn

punctuation is optional and dashes may be inserted anywhere in the number.

none

Refers to no telephone. The keyword none is the language specific value given in v4_home:V4LanguageInfo.v4i.

other

A special keyword that has previously been assigned to this point type with the V4(Name::keyword) module.

Description

This dimension type is used to primarily represent telephone numbers. V4 supports numbers consisting of a country code, a city or area code and a number. The country code and area code is optional. If no country code is specified then the country code for the current country (see the Locale module) is used.

The MakeP module can be used to construct telephone number points.

The explicit coercion of a telephone point to a list results in a list containing the componend parts of the telephone number- (countrycode areacode number). The List module and Nth argument option may be used to extract components of the number.

This dimension type may also be used to represent other forms of electronic addressing such as email addresses or instant messaging addresses. When a non-standard phone number is encountered a special acceptor is attempted. V4 creates and evaluates a binding of the form [UV4:AcceptorTele alphastring] where alphastring is a point on Dim:Alpha representing the address. The result must be a point of type Integer or Integer2. If an integer is returned then the value is stored as the number portion of the point. If an integer2 point is returned then the first half is stored as the area code (limited to 16 bits) and the second as the 32 bit number.

These alternate forms of a telephone number also flow through a displayer evaluation of the form [UV4:DisplayerTele int2value] where int2value is the areacode and number components of the value. See below for an example of how this all fits together.

Examples

  (800)555-1234
  8005551234 both numbers are equivalent
  MakeP(Dim:Tele 800 5551234) creates telephone point identical to above on dimension Tele
  [Exchange Tele..] List(List:=Tele* Nth::2) extracts the area code from a telephone number point
  Dim THash Int Bind 5 A behind-the-scenes dimension
  [UV4:AcceptorTele Alpha..] This is the acceptor binding
   Do(Context::Str(Alpha* Hash32?) BindQE([Email THash:=Int*] Alpha*) Int*) Only using the number
  [UV4:DisplayerTele Int2..] This is the displayer binding
   [EMail THash:=List(List:=Int2* Nth::2)],"?" (only looking at the number portion)

Time - Time Dimension Type

Dimension Declaration

Dimension name Time

Value Syntax

nnnn

where nnnn is an integer number.

none

Refers to no time. The keyword none is the language specific value given in v4_home:V4LanguageInfo.v4i.

Description

Points of type Time differ from all other points in V4 in that an exact match is not required in an evaluation. A time point matches any other time point greater or equal to it with the closest point being the "best". For example if a binding was created with a time point of "100" and it is now time "150", the match would be made. However if the current time was "95" then a match would not be permitted (the point at "100" would be in the future relative to time "95").

Note that time dimensions should not be assigned a Bind value when declared.

Examples

  Dim T Time
Bind [Value T:100] "Value at 100"
Bind [Value T:200] "Value at 200"
Bind [Value T:300] "Value at 300"
  = [Value T:400] results in "Value at 300"
  = [Value T:124] results in "Value at 100"
  = [Value T:90] fails

UDate - Universal Date Dimension Type

Dimension Declaration

Dimension name UDate

Value Syntax

yyyymmdd

where yyyy is the year, mm is the month, and dd is the day. (Note: See the YMDOrder attribute)

yymmdd

If only two digits of the year are given then any year less than 20 is assumed to be in the 21st century otherwise the 20'th century is used. (Note this convention will probably change as we progress into the 21st century.)

mmddyy

If the dimension is declared with the MMDDYY attribute then dates are assumed to be month-day-year, not yymmdd.

#nnnn

where nnnn is the internal number of days offset from the base date.

+days

represents days from today.

-days

represents days ago.

relexp

A relative date expression, See here for details and examples.

Today

represents the current date. (See v4_home:V4LanguageInfo.v4i for language specific values.)

Current

represents the current date. (See v4_home:V4LanguageInfo.v4i for language specific values.)

Yesterday

represents yesterday's date.

Tomorrow

represents tomorrow's date.

none

Refers to no date. The keyword none is the language specific value given in v4_home:V4LanguageInfo.v4i. For historical reasons the null value is equivalient to dim:#0.

other

A special keyword that has previously been assigned to this point type with the V4(Name::keyword) module.

{now}

always refers to the current date. This construct differs from "Today" above in that it represents the current date whenever it is referenced. All of the other dates are static and are determined when parsed, not referenced.

{current}

This is synonomous with {now}.

Description

A universal date is a 32 bit integer representing the number of days from the base date of 17-Nov-1858 (Smithsonian Astronomical Standard).

Small negative values for dates are permitted to represent non-date dates such as "TBD" or "n/a" (see the Name tag within the V4 module description.) When formatted (Format) or exported to HTML or Excel negative dates are converted to dates beginning with January 1, 1800 (-1 becomes 1-Jan-1800, -2 becomes 2-Jan-1800, etc.)

Universal dates span the range of dates from November 17, 1858 through August 31, 2132.

The YMDOrder option may be given to specify the ordering of year, month, and day within a date value.

Examples

  Dim UDate UDate
Bind [IM:Item123 UDate:951001 Sales] 4300
  UDate:-7..+3 a range of dates from 7 days ago to 3 days from now

UMonth - Universal Month Dimension Type

Dimension Declaration

Dimension name UMonth

Value Syntax

yyyymm

where yyyy is the year and mm is the month. (Note: See the YMDOrder attribute)

yymm

See UDate for specifying the year with only two digits.

#nnnn

where nnnn is the internal number representing the number of months from the base month of January 1850.

relexp

A relative date expression, See here for details and examples.

{now}

always refers to the current month

{current}

This is synonomous with {now}.

Current

This is synonomous with {now}.

none

Refers to no month. The keyword none is the language specific value given in v4_home:V4LanguageInfo.v4i. For historical reasons the null value is equivalient to dim:#0.

other

A special keyword that has previously been assigned to this point type with the V4(Name::keyword) module.

Description

A universal month is a 32 bit integer representing the number of months from the base month of January 1850.

The YMDOrder option may be given to specify the ordering of year, month, and day within a date value.

Small negative values for dates are permitted to represent non-date dates such as "TBD" or "n/a" (see the Name tag within the V4 module description.) When formatted (Format) or exported to HTML or Excel negative dates are converted to months beginning with January 1800 (-1 becomes Jan-1800, -2 becomes Feb-1800, etc.)

Years must be within the range of 1858 to 2200.

Examples

  Dim UMonth UMonth
Bind [Cus* UMonth:9501 Sales] 4300

Unicode - Unicode Dimension Type

Dimension Declaration

Dimension name Unicode

Value Syntax

Description

The Unicode dimension type is used for expanded alpha-numeric points. Points are stored as a string of 16-bit bytes. See the Alpha dimension type for more information.

Examples

UOM - Units of Measure

Dimension Declaration

Dimension name UOM

Value Syntax

nnnsss

where nnn is a number or quantity and sss is a unit-of-measure suffix.

pppnnn

where ppp is a unit-of-measure prefix and nnn is a number or quantity.

none

Refers to no unit-of-measure. The keyword none is the language specific value given in v4_home:V4LanguageInfo.v4i.

Description

The V4 unit-of-measure (and associated unit-of-measure-per) point type permits the designer to represent and manipulate many different unit-of-measure quantities. Examples include weight conversions, time conversions, quantity conversions, and currency conversions.

V4 has no predefined units-of-measure. The UOM module is used to define interrelationships among different units (e.g. 1 dozen = 12 each).

Examples

  Dim U UOM Range UOMId 1 defines a unit-of-measure dimension
  UOM(Id::1 Index::1 Factor::1 Label::"ea" Partial::1) defines "ea" (for each)
  UOM(Id::1 Index::2 Factor::12 Label::"dz") defines "dz" (for dozen)
  { U:1dz / U:1e } results in Num:12
  { U:1ea / U:1dz } results in Num:0.0833333333333333
  {U:1dz + U:1} results in U:1.08333333333333dz (U:1 defaults to '1ea')
  Sum((U:1dz U:2dz U:3ea)) results in U:39ea

UOMPer - Quantity per Units of Measure

Dimension Declaration

Dimension name UOMPer

Value Syntax

nnnn/uom

where scaler is a an integer or floating point number and uom is a valid unit-of-measure specification.

none

Refers to no UOMPer. The keyword none is the language specific value given in v4_home:V4LanguageInfo.v4i.

Description

The UOMPer point type associates a scaler with a unit of measure. A common example would be the price of produce at a supermarket. Produce is often sold at $x per some unit, often weight.

Examples

  Dim U UOM Range UOMId 1 define unit of measure
  Dim P UOMPer Range UOMId 1 define per-unit of measure dimension
  Bind [UV4:UOMInitialize] define binding that is automatically evaluated to define the unit of measure dimensions.
   Do(UOM(Id::1 Index::1 Factor::1 Label::"ea" Partial::1)
    UOM(Id::1 Index::2 Factor::12 Label::"dz"))
  { U:12ea * P:10.55/1dz } results in Num:10.55
  { U:12dz * P:10.0/1dz } results in Num:120
  { U:12dz * P:10.55/1ea } results in Num:1519.2
  { P:10.55/1dz / U:12ea} fails - this is meaningless

UOMPerUOM - Unit of Measure per Unit of Measure

Dimension Declaration

Dimension name UOMPerUOM

Value Syntax

no syntax

points may only be constructed with the MakeP module.

Description

The UOMPerUOM point type combines two units-of-measure into a single point type. There is currently only limited support for this point type within V4. The only arithmetic operation supported for this point type is multiplication (Mult). Multiplying a UOMperUOM point by a UOM point, where the UOM matches the denominator (second) UOM of the UOMperUOM point results in a UOM point from the numerator. The V4 module UOM may be used to break a UOMperUOM point into its component units-of-measure.

Examples

UPeriod - Universal (Accounting) Period

Dimension Declaration

Dimension name UPeriod

Value Syntax

yyyypp

where yyyy is the year and pp is a period (1-13 or 90-99)

yypp

See UDate for specifying the year with only two digits.

#nnnn

where nnnn is the internal period number with period #0 being 1850/01

none

Refers to no period. The keyword none is the language specific value given in v4_home:V4LanguageInfo.v4i. For historical reasons the null value is equivalient to dim:#0.

other

A special keyword that has previously been assigned to this point type with the V4(Name::keyword) module.

Description

Dimensions of this type represent accounting periods. There are normally thirteen periods in a year. Periods are represented as consecutive numbers so that arithmetic can be performed. For instance {Period* + 13} represents the same period in the next year. The difference between two periods is the number of periods between them.

The default of 13 periods per year can be altered by giving the Periods num option.

There are 10 special periods per year which can be used to represent year end adjustment periods. These are represented by the periods 90 through 99. The adjustment periods are not consecutive and arithmetic on these will not yield meaningful results. Some example periods are shown below-

Period years must be within the range of 1858 to 2200.

Examples

  Dim P UPeriod
  P:9703 is the third period of fiscal 1997
  P:9613 is the last period of fiscal 1996
  P:9791 is a year-end adjustment period

UQuarter - Universal Quarter

Dimension Declaration

Dimension name UQuarter

Value Syntax

yyyyqq

where yyyy is the year and qq is a quarter (01-04)

yyqq

See UDate for specifying the year with only two digits.

relexp

A relative date expression, See here for details and examples.

#nnnn

where nnnn is the internal quarter number with quarter #0 being 1850/01

?Dim:NId Current

The current quarter.

none

Refers to no quarter. The keyword none is the language specific value given in v4_home:V4LanguageInfo.v4i. For historical reasons the null value is equivalient to dim:#0.

other

A special keyword that has previously been assigned to this point type with the V4(Name::keyword) module.

Description

Dimensions of type UQuarter represent the quarters of a year. There are, obviously, four quarter per year and they are internally represented as consecutive numbers so that arithmetic is possible. Examples of quarters are-

Examples

  Dim Q Quarter
  Q:9703 the third quarter of 1997
  Minus(Q:9703 Q:9603) returns 4

URL - A Uniform Resource Locator

Dimension Declaration

Dimension name URL

Value Syntax

same as Alpha

Description

The URL point type is currently parsed and handled as an Alpha point type. It has been included for future functionality.

Examples

UTime - Universal DateTime Time

Dimension Declaration

Dimension name UTime

Value Syntax

hh:mm[:ss[.?Dim:NId ff]]

where hh is the hour (0-23), mm is the minute (0-59), ss is the optional seconds (0-59), and ff is optional fractional seconds.

none

Refers to no time. The keyword none is the language specific value given in v4_home:V4LanguageInfo.v4i. The null value is equivalient to dim:#-1.

other

A special keyword that has previously been assigned to this point type with the V4(Name::keyword) module.

Description

UTime points represent the seconds in any given day. The values span period from midnight to 11:59:59. UTime points are not associated with any particular date. Use the DateTime point type to reference a time within a given day.

Examples

  T:12:01:30 corresponds to 90 seconds past noon

UWeek - Universal Week

Dimensions of type UWeek represent the weeks of a year. There are 52 weeks in a given year and like all the other U-time dimension types, are stored internally as consecutive numbers.

V4 provides an automatic mapping from UDate to UWeek on the assumtpion that weeks start on Mondays. This cannot be a perfect mapping because a year may have 365 or 366 days while 52*7 is only 364 days. A further complication is attempting to have all weeks begin on a particular day. The compromise made by V4 is to assign the first Monday of each year as the basis for week 1 of that year. However all days in the year before that first Monday are also included in week 1. It is also possible to have a year with more than 52 Mondays. In this case, any days of a year that would roll into week 53 are automatically truncated back to week 52. It is up to those of you using the UWeek dimension to figure how best to handle the end-of-year and begin-of-year rollover.

V4 supports an alternative meaning for points of UWeek- the number of weeks based on an arbitrary starting date defined when the dimension is declared (see the BaseDate option in the Dimension command and the BaseDate option in the Dim module). In this case the week is treated as an integer week number with the first week being week 1. Week numbers less than 1 are not defined. The coercion of UDate to UWeek in this case is straightforward- the offset from the base date divided by 7.

Dimension Declaration

Dimension name UWeek

Value Syntax

yyyyww

where yyyy is the year and w is a week (01-52)

yyww

See UDate for specifying the year with only two digits.

ww

The week number off of the base date, with 1 corresponding to the first week.

#nnnn

where nnnn is the internal week number with week #0 being 1850/01

none

Refers to no week. The keyword none is the language specific value given in v4_home:V4LanguageInfo.v4i. For historical reasons the null value is equivalient to dim:#0.

other

A special keyword that has previously been assigned to this point type with the V4(Name::keyword) module.

Description

Years must be within the range of 1858 to 2200.

Examples

  Dim W UWeek
  W:9713 the 13th week of 1997
  {53 + W:9602} W:9703

UYear - Universal Year

Dimension Declaration

Dimension name UYear

Value Syntax

yyyy

where yyyy is the year

yy

See UDate for specifying the year with only two digits

relexp

A relative date expression, See here for details and examples.

{now}

always references the current year

{current}

This is synonomous with {now}.

Current

This is synonomous with {now}.

none

Refers to no year. The keyword none is the language specific value given in v4_home:V4LanguageInfo.v4i. For historical reasons the null value is equivalient to dim:#0.

other

A special keyword that has previously been assigned to this point type with the V4(Name::keyword) module.

Description

Dimensions of type UYear represent years.

Examples

  Dim Y UYear
  Y:1996 the year 1996
  In(UDate:970415 Y:1996..1998) Logical:True

V4IS - A V4IS Area/Record

Dimension Declaration

Dimension name V4IS

Value Syntax

V4IS points are created solely via the V4ISCon module.

none

Refers to no V4IS point. The keyword none is the language specific value given in v4_home:V4LanguageInfo.v4i.

Description

Universal years must be within the range of 1858 to 2200.

Points on dimensions of this type represent V4IS areas and records. The V4ISxxx modules are the only way to manipulate points on a V4IS dimension.

Examples

  Context(V4ISCon(Dim:V Area::"table.dat" FileRef::9027 Open::1 KeyNum::1 Key::1))

XDB - An External Database Connection/Query Point

Dimension Declaration

Dimension name XDB

Value Syntax

none

Refers to no XDB point. The keyword none is the language specific value given in v4_home:V4LanguageInfo.v4i.

XDB points are created solely via the DBConnect internal module.

Description

XDB points are created by V4 to represent various connections and query states to external (e.g. relational) databases. XDB points cannot be explicitly referenced.

Examples

  Dim pXDB create XDB dimension
  [SQLXct DataSet.. SQLCmd..] evaluation connects to SQL database and executes specified SQL command
  Do(dbConnect(Dim:pXDB DSN::DataSet*) Value::dbXct(SQL::SQLCmd*) dbFree())