GetCount function
Prototype: |
function GetCount: integer; |
|
Description: |
The GetCount function returns the number of elements stored in the XMLElementList. |
|
Syntax: |
variable := TScriptXMLElementList.GetCount; |
|
Part |
Description |
|
variable |
A variable declared as an integer |
|
TScriptXMLElementList |
A variable declared as an instance of the TScriptXMLElementList class |
|
Return value: |
The number of elements stored in the XMLElementList (an instance of the TScriptXMLElementList class) |
|
Note: This function is available since version X7.
Example:
var
ElementList: TScriptXMLElementList;
Element: TScriptXMLElement;
i: integer;
AttributeName, LayerName: string;
begin
// open XML document and assign Element
ElementList := Element.GetChildElements('');
for i := 0 to ElementList.GetCount - 1 do
begin
with ElementList.GetElement(i) do
begin
if HasAttribute('LAYER') then
LayerName := GetStringAttributeAsString('LAYER');
if HasAttribute('ATTRIBUTE') then
AttributeName := GetStringAttributeAsString('ATTRIBUTE');
end;
end;
end.
See also:
© 2024 IFER-Monitoring and Mapping Solutions