Subtype - property of the PmfNumber object
Description:
Specifies whether the object displays/inputs integer, real number, date and time or time span.
Values:
DateTime - Date and time. For the desired displaying, it is necessary to set format of date and time in the
Format property.
TimeSpan - Time span. For the desired displaying, it is necessary to set format of time span in the
Format property.
Note:
Property access
for read and write.
It is possible to write into this property only if the
PmForm window has not been opened yet.
This property is also functional in
Web panels.
Example1:
Creates two numeric input items: first one for integer and the second for real number:
JavaScriptSelect and copy to clipboard
var oNumber1 = oForm.CreateItem("number", "Nmb1", "Number of packages", "Min:0;Max:33;");
var oNumber2 = oForm.CreateItem("number", "Nmb2", "The size of one package in cm", "Subtype:float;Min:19.8;Max:120.5;");
var sSubtype1 = oNumber1.Subtype;
// int
var sSubtype2 = oNumber2.Subtype;
// float
Example2:
Creates two entry items: the first for date and time and the second for time span:
JavaScriptSelect and copy to clipboard
var oDateTime = oForm.CreateItem("auto", "Nmb1", "Date and time", "Format:{Type:DateTime;Fmt:%2d.%2m.%4Y %2H:%2M:%2S};");
var oTimeSpan = oForm.CreateItem("auto", "Nmb2", "Time span", "Format:{Type:TimeSpan;Fmt:%*d %*H:%*M:%*S};");
oDateTime.Value = Pm.CreateDate(2025, 3, 22, 12, 30, 30, 500);
oTimeSpan.Value = Pm.CreateDate(0, 0, 0, 4, 15, 6, 789);