SOLVED!!! See post #8.
I need some help get this script to work. No experience. I need to evaluate my assignments circle1 and circle2 and depending on the results, move to a certain label. The assignments are in my program an I didn't include them into the script. The script compiles successfully in the script editor but when I execute the routine, pcdmis freezes. It looks like its gets locked up when it gets to the script and becomes unresponsive. Then I have to force pcdmis to close and try again.
I exported by program as basic and deleted everything I thought was not needed. I either deleted something I wasn't suppose to OR need to add extra command, idk. I need to check if my circle1 AND circle2 fit my criteria. If yes, goto label pass, Else, goto label fail. Labels in my program lead to folder locations. I can get it work in my program however I need to add way more features and my line ran out of room so I figured a script was the way to go.
Any advice?
I need some help get this script to work. No experience. I need to evaluate my assignments circle1 and circle2 and depending on the results, move to a certain label. The assignments are in my program an I didn't include them into the script. The script compiles successfully in the script editor but when I execute the routine, pcdmis freezes. It looks like its gets locked up when it gets to the script and becomes unresponsive. Then I have to force pcdmis to close and try again.
I exported by program as basic and deleted everything I thought was not needed. I either deleted something I wasn't suppose to OR need to add extra command, idk. I need to check if my circle1 AND circle2 fit my criteria. If yes, goto label pass, Else, goto label fail. Labels in my program lead to folder locations. I can get it work in my program however I need to add way more features and my line ran out of room so I figured a script was the way to go.
Any advice?
Code:
IF/CIRCLE1<0.005 AND CIRCLE2<0.005 GOTO/PASS END_IF/ ELSE/ GOTO/FAIL END_ELSE/
Code:
Dim DmisApp As Object Dim DmisPart As Object Dim DmisCommands As Object Dim DmisCommand As Object Sub Part1 Set DmisApp = CreateObject("PCDLRN.Application") Set DmisPart = DmisApp.ActivePartProgram Set DmisCommands = DmisPart.Commands CommandCount = DmisCommands.Count Set DmisCommand = DmisCommands.Item(CommandCount) DmisCommands.InsertionPointAfter DmisCommand Set DmisCommand = DmisCommands.Add(IF_BLOCK_COMMAND, True) DmisCommand.Marked = True ' Set Mode = 3 retval = DmisCommand.PutText ("3", MODE_TYPE, 0) ' Set Source Expression = 1 retval = DmisCommand.PutText ("1", SRC_EXPR, 0) Result = DmisCommand.SetExpression("CIRCLE1<0.005 AND CIRCLE2<0.005", SRC_EXPR, 0) Set DmisCommand = DmisCommands.Add(GOTO_COMMAND, True) DmisCommand.Marked = True ' Set Mode = 0 retval = DmisCommand.PutText ("0", MODE_TYPE, 0) ' Set Label = PASS retval = DmisCommand.PutText ("PASS", LABEL_ID, 0) Set DmisCommand = DmisCommands.Add(END_IF_COMMAND, True) DmisCommand.Marked = True ' Set Mode = 3 retval = DmisCommand.PutText ("3", MODE_TYPE, 0) Set DmisCommand = DmisCommands.Add(ELSE_COMMAND, True) DmisCommand.Marked = True ' Set Mode = 5 retval = DmisCommand.PutText ("5", MODE_TYPE, 0) Set DmisCommand = DmisCommands.Add(GOTO_COMMAND, True) DmisCommand.Marked = True ' Set Mode = 0 retval = DmisCommand.PutText ("0", MODE_TYPE, 0) ' Set Label = FAIL retval = DmisCommand.PutText ("FAIL", LABEL_ID, 0) Set DmisCommand = DmisCommands.Add(END_ELSE_COMMAND, True) DmisCommand.Marked = True ' Set Mode = 5 retval = DmisCommand.PutText ("5", MODE_TYPE, 0) End Sub Sub Main Part1 Part2 DmisPart.RefreshPart End Sub
Comment