Removing a node from db based on mgGetCode(rec) == fltSwitch
S
Shawn
started a topic Friday, Nov 04, 2022
Greetings,
I'm building this script from the ground up to remove switch nodes. I am aware that I can do this safely in the PostWalk.
Here's the relevant conundrum:
code = mgGetCode(rec)
and I print that code, I get 362. If I do this:
if code == fltSwitch:
then this code executes.
What's going on, why does the print see this as 362?
Thanks
1 Comment
C
Chris
said Monday, Nov 07, 2022
This is expected. fltSwitch is a constant value identifying a switch node. The value of this constant is 362 in the kernel. mgGetCode of a switch rec will return 362, which is the same thing as the fltSwitch constant.
Shawn
Greetings,
I'm building this script from the ground up to remove switch nodes. I am aware that I can do this safely in the PostWalk.
Here's the relevant conundrum:
code = mgGetCode(rec)
and I print that code, I get 362. If I do this:
if code == fltSwitch:
then this code executes.
What's going on, why does the print see this as 362?
Thanks