List Default Column Types (When Defined With Names Only)
Data1, Data2, Data3 etc are pre-declared within a Map, but must be explicitly declared within a Custom Script.
Data1, Data2, Data3 etc are pre-initialised within a Map, but must be explicitly initialised within a Custom Script.
Data1, Data2, Data3 etc are cleaned up automatically by a Map, but must be explicitly removed for Custom Script.
procedure
ScriptEvent (
var
Value : variant);
var
Data1: TFloClientDataSet; f:
integer
; vField: TField; vInfoStr:
string
;
begin
Data1 := TFloClientDataSet
.
Create(
nil
);
{ DEFINE the column structure of the dataset -
specify Names and accept default Type(Size) of string(255)}
// create the dataset, with columns named 'ID' and 'Name'
GetCustomDataSet(Data1,[
'ID'
,
'Name'
]);
for
f :=
0
to
(Data1
.
Fields
.
Count -
1
)
do
begin
vField := Data1
.
Fields
.
Fields[f];
vInfoStr :=
'Field/column '
+ IntToStr(f) +
': '
;
vInfoStr := vInfoStr +
'Name='
+ vField
.
FieldName +
';'
;
vInfoStr := vInfoStr +
'Type='
+ IntToStr(Ord(vField
.
DataType)) +
';'
;
vInfoStr := vInfoStr +
'Size='
+ IntToStr(vField
.
Size) +
';'
;
vInfoStr := vInfoStr + IfThen(vField
.
Required,
'Reqd=Yes'
,
'Reqd=No'
) +
'.'
;
LogInfo(vInfoStr);
end
;
if
(Assigned(Data1))
then
Data1
.
Free;
end
;
The list of column Type index values and codes is set out in TFieldType .