This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20.6
Get last field number
|
Get last field number ( tableNum | tablePtr ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
tableNum | tablePtr | Longint, Pointer |
![]() |
Table number or Pointer to table | |||||
Function result | Longint |
![]() |
Highest field number in table | |||||
The Get last field number command returns the highest field number among the fields in the table whose number or pointer you pass in tableNum or tablePtr.
Fields are numbered in the order in which they are created. If no field has been deleted from the table, then this command returns the number of fields that the table contains. In the case of iterative loops on the field numbers of the table, you must use the Is field number valid command in order to check whether the field has been deleted.
The following project method builds the array asFields, consisting of the field names, for the table whose pointer is received as first parameter:
$vlTable:=Table($1)
ARRAY STRING(31;asFields;Get last field number($vlTable))
For($vlField;Size of array(asFields);1;-1)
If(Is field number valid($vlTable;$vlField))
asFields{$vlField}:=Field name($vlTable;$vlField)
Else
DELETE FROM ARRAY(asFields;$vlField)
End if
End for
Field name
GET FIELD PROPERTIES
Get last table number
Is field number valid
Product: 4D
Theme: Structure Access
Number:
255
Modified: 4D v11 SQL
4D Language Reference ( 4D v20)
4D Language Reference ( 4D v20.1)
4D Language Reference ( 4D v20.2)
4D Language Reference ( 4D v20.3)
4D Language Reference ( 4D v20.4)
4D Language Reference ( 4D v20.5)
4D Language Reference ( 4D v20.6)