WR GET REFERENCE

4D - Documentation   Français   English   German   4D Write, Command Theme List   4D Write, Command Alphabetical List   4D Write, Constant Theme List   Back   Previous   Next

version 6.7 (Modified)


WR GET REFERENCE (area; info1; info2; name; type{; numFormat{; dateFormat{; timeFormat}}})

ParameterTypeDescription
areaLongint4D Write area
info1IntegerFirst information regarding the reference
info2IntegerSecond information regarding the reference
nameStringReceives reference name
typeIntegerReceives reference type
numFormatStringNumeric format
dateFormatIntegerNumber of the date format
timeFormatIntegerNumber of the time format

Description

The WR GET REFERENCE command gets information about the selected reference in the 4D Write area.

Information about the selected reference is returned into the info1, info2, name and type parameters. You can also find out the display format of numeric, Date or Time inserted references.

Values returned in info1, info2, and name depend on the value in type. If the selected object is not a reference, type returns 0.

If type=1, the reference is a field. info1 indicates the table number. info2 indicates the field number. name is empty.

If type=2, the reference is an expression. info1 and info2 contain the value 0. name contains the name of the variable or expression.

The numFormat parameter returns a string indicating the format of the selected numeric field/expression (i.e., Real, Integer, or Longint). If no format is associated with the expression or if it is not a numeric type expression, an empty string is returned.

The dateFormat parameter returns the number of the Date format associated with the selected field/expression, if it is a date type. Should this not be the case, the value 0 is returned.

Following are the format codes for dates:

Date formatNameNumber
1/6/00(Short)1
Thu, Jan 6 2000(Abbreviated)2
Thursday, January 6 2000(Long)3
01/06/2000(MM DD YYYY)4
January 6, 2000(Month Day Year)5
Jan 6, 2000(Abb Month Day)6
01/06/2000(MM DD YYYY Forced)7

The timeFormat parameter returns the number of the time format associated with the selected field/expression, if it is a time type. Should this not be the case, the value 0 is returned.

Following are the format codes for times:

Time formatNumber
HH:MM:SS1
HH:MM2
HH hours MM minutes SS seconds3
HH hours MM minutes4
HH:MM AM PM5

Example

This example determines if the user selected an object that is a reference. It also tells the user if the selected object is a field or an expression.

   WR GET REFERENCE (Letter;$Table;$Field;$Name;$Type)
   Case of
      : ($Type=0)    `Text or nothing
         ALERT("Selected text or nothing")
      : ($Type=1)
         ALERT("Selected the field "+Field name($Table;$Field))
      : ($Type=2)
         ALERT("Selected the expression named "+$Name)
   End case

See Also

WR INSERT EXPRESSION, WR INSERT FIELD.


4D - Documentation   Français   English   German   4D Write, Command Theme List   4D Write, Command Alphabetical List   4D Write, Constant Theme List   Back   Previous   Next