OP Get field properties

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

version 1.5


OP Get field properties (connectionID; tableID; tableInvisible; fieldNames; fieldTypes; fieldLengths; fieldIndexed; fieldInvisible) Longint

ParameterTypeDescription
connectionIDLongintConnection ID with target server
tableIDLongintNumber of the table in the database
tableInvisibleLongintTable visibility
fieldNamesArrayArray of fields names for target table
fieldTypesArrayArray of field types for target table
fieldLengthsArrayArray of field lengths for target table
fieldIndexedArrayArray of field "index" properties for target table
fieldInvisibleArrayArray of field "visible" properties for target table
Function resultLongintError code result for the function

Description

OP Get field properties returns the name and type of all fields in the specified table. It also returns the length of all alpha fields in the table and indicates whether or not each field is indexed, and whether or not each field is invisible.

tableInvisible returns 1 if tableID is invisible. Otherwise, tableInvisible returns 0.

fieldNames must be an array of type String or Text.

fieldTypes must be an array of type String, Text, Real, Integer or Longint. The values returned in fieldTypes depend on the type of array passed:

Alpha ArrayNumeric Array
"Alphanumeric"0
"Real"1
"Text"2
"Picture"3
"Date"4
"Boolean"6
"Subfile"7
"Integer"8
"Long Integer"9
"Time"11

fieldLengths can be an array of type String, Text, Real, Integer, or Long Integer. If the array is of type String or Text, the value passed is a numeric string. If the array is of type Real, Integer, or Long Integer, the value passed is a number. The values returned by Indexed vary depending on the type of array passed:

Alpha ArrayNumeric ArrayBoolean Array
Field is indexed"Indexed"1True
Field is not indexed"" (empty string)0False

The values returned by InvisibleField vary depending on the type of array passed:

Alpha ArrayNumeric ArrayBoolean Array
Field is invisible"Invisible"1True
Field is not invisible"" (empty string)0False

Error Codes

If OP Get fields properties executes successfully, it returns 0. Otherwise, this function returns one of the following errors:

Error CodeDescription
-108Not enough memory to perform this operation.
-9972File number is out of range.
10128The 4D Open for 4th Dimension package has not been initialized.
10135Invalid parameter type.
10136The connection does not exist.
10154This command cannot be executed right now.

Example

In this example, arrays are used to store information about fields in a file.

   C_LONGINT($File;$ErrCode)

   ARRAY LONGINT(aTypes;0)   `…field types
   ARRAY LONGINT(aLength;0)   `… field length (for alpha fields)
   ARRAY LONGINT(aIndexes;0)   `…indexed?
   ARRAY LONGINT(aInvisible;0)   `…invisible?
   ARRAY STRING(15;aNames;0)   `…field names

   $File:=1  `…get information on file 1

   $ErrCode:=OP Load network component ($CompID)
   $ErrCode:=OP Open connection ($ServerID;$ConnectID;"4D 3.2";"Designer";$Password;"Nomad")
   $ErrCode:=OP Get field properties ($ConnectID;$File;$Invisible;aNames;aTypes;
                                          aLength;aIndexes; aInvisible)

See Also

GET FIELD PROPERTIES.


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