IF_GOTO/TYPE==1,GOTO = CS1
GOTO/PROBLEM
We are using a trace field which is put into a variable "TYPE" to ensure that we are using the correct program at the correct machine. (We have a hodge-podge of different machine/probe types. TIGO, LSPS, SP25.)
The reason is that the probe options are different per machine type, so we use a trace field to ensure that the user is running the right version of the program.
In any case, the above code is in all of our programs in a particular department. (That department has up until now, only run SP25 probes, but they will be getting LSPS probes soon.)
Therefore, I want to automate the ability to take an existing SP25 program and convert it to LSPS.
I will need to change the OPTIONPROBE settings, but that comes later.
My first problem is how to change the above code to read:
IF_GOTO/TYPE==3,GOTO = CS1
Here's part of the code from my basic script:
Set App = CreateObject("PCDLRN.Application")
Set Part = App.ActivePartProgram
strCrntName = Part.FullName
dmis_version_string = App.VersionString
If UCase(dmis_version_string) <> "2020 R2" Then
MsgBox "It's not running in 2020."
Exit Sub
End If
Set DmisCommands = Part.Commands
command_count = DmisCommands.Count
Set DmisCommand = DmisCommands.Item(command_count)
DmisCommands.InsertionPointAfter DmisCommand
For Each DmisCommand In DmisCommands
'74 = FlowControlCmd
If DmisCommand.Type = 74 Then
'here's where I need to change the FlowControlCmd's expression.
End If
...Code continues on from here...
I know that I need to convert the generic DMISCommand to a FlowControlCmd object, but I don't know how to do this.
Then how to I change the expression?