Skip to content

Commit f1637ee

Browse files
authored
Update functions.fn
Prüfen, ob Objekt vom Typ CHANNEL ist
1 parent 6a00888 commit f1637ee

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

regascripts/functions.fn

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
object oFunction;
99
string sFunctionId;
1010
string sChannelId;
11+
object oChannel;
1112
boolean bFirst = true;
1213
boolean bFirstSecond = true;
1314

@@ -28,14 +29,18 @@ foreach (sFunctionId, dom.GetObject(ID_FUNCTIONS).EnumUsedIDs()) {
2829
Write('", "Channels": [');
2930
bFirstSecond = true;
3031
foreach(sChannelId, oFunction.EnumUsedIDs()) {
32+
oChannel = dom.GetObject(sChannelId);
33+
! Objekt ueberspringen, falls nicht vom Typ CHANNEL (33)
34+
if (oChannel.Type() != 33) { continue; }
35+
3136
if (bFirstSecond == false) {
3237
Write(',');
3338
} else {
3439
bFirstSecond = false;
3540
}
36-
string sIfaceId = dom.GetObject(sChannelId).Interface();
41+
string sIfaceId = oChannel.Interface();
3742
string sIface = dom.GetObject(sIfaceId).Name();
38-
Write('{"Address":"' # dom.GetObject(sChannelId).Address() # '",');
43+
Write('{"Address":"' # oChannel.Address() # '",');
3944
Write('"Interface":"' # sIface # '"}');
4045
}
4146
Write(']}');

0 commit comments

Comments
 (0)