Here is a snippet of code out of my tracefield program:

Code:
  For Each PCDCommand In PCDCommands

                    If PCDCommand.Type
...