hexagon logo

Broken Script

Hey all. I hope someone can help me. This won't run Confused

I'm using 4.2 MR3

Sub Main

Begin Dialog DIALOG_1 53,9, 211, 287, "Dialog One", .enable
  OptionGroup .GROUP_1
    OptionButton 16,80,80,12, "1st Piece Sign-Off"
    OptionButton 16,96,80,12, "In-Process Scan"
    OptionButton 16,112,84,12, "Audit"
  GroupBox 4,4,200,280, " "
  TextBox 40,156,32,12, .EditBox_1
  TextBox 40,176,32,12, .EditBox_2
  TextBox 40,196,32,12, .EditBox_3
  TextBox 40,216,32,12, .EditBox_4
  Text 16,140,52,12, "Enter Scan #'s:"
  Text 16,64,72,12, "Enter Scan Type:"
  Text 16,236,180,12, "NOTE: Enter Scan #'s in the station you want to run."
  Text 16,156,24,12, "ST 1:"
  Text 16,176,24,12, "ST 2:"
  Text 16,196,24,12, "ST 3:"
  Text 16,216,24,12, "ST 4:"
  Text 64,20,76,12, "Enter Work Order #:"
  TextBox 64,36,72,12, .EditBox_5
  OKButton 16,260,48,16
  CancelButton 140,260,48,16
End Dialog

Dim app As Object 
Set App = CreateObject("pcdlrn.Application") 

Dim part As Object 
Set Part = App.activePartProgram 

Dim cmds As Object 
Dim cmd As Object 

Dim dlg1 As Menu 
button = Dialog( Dlg1 ) 

Dim sel_text As String 
Dim STATION1 As String 
Dim STATION2 As String 
Dim STATION3 As String 
Dim STATION4 As String 
Dim WORKORDER As String 

If button = 0 Then
    sel_text = "END"
End If

If button = -1 Then 
    Select Case Dlg1.GROUP_1 
        Case 0 
            sel_text = "SIGN-OFF"
        Case 1 
            sel_text = "IN-PROCESS"
        Case 2 
            sel_text = "AUDIT"
    End Select 

    STATION1 = Dlg1.EditBox_1
    STATION2 = Dlg1.EditBox_2
    STATION3 = Dlg1.EditBox_3
    STATION4 = Dlg1.EditBox_4

    WORKORDER = Dlg1.EditBox_5
End If 

Set cmds = part.Commands 
For Each cmd In cmds 

If cmd.TypeDescription = "Assignment" Then 
    If cmd.gettext(dest_expr,0) = "TYPE" Then
        bln = cmd.PutText("""" + sel_text + """", SRC_EXPR, 0)
        cmd.ReDraw
    End If 
    If cmd.gettext(dest_expr,0) = "ST1" Then
        bln = cmd.PutText("""" + STATION1 + """", SRC_EXPR, 0)
        cmd.ReDraw
    End If 
    If cmd.gettext(dest_expr,0) = "ST2" Then
        bln = cmd.PutText("""" + STATION2 + """", SRC_EXPR, 0)
        cmd.ReDraw
    End If 
    If cmd.gettext(dest_expr,0) = "ST3" Then
        bln = cmd.PutText("""" + STATION3+ """", SRC_EXPR, 0)
        cmd.ReDraw
    End If 
    If cmd.gettext(dest_expr,0) = "ST4" Then
        bln = cmd.PutText("""" + STATION4 + """", SRC_EXPR, 0)
        cmd.ReDraw
    End If 
    If cmd.gettext(dest_expr,0) = "WO" Then
        bln = cmd.PutText("""" + WORKORDER+ """", SRC_EXPR, 0)
        cmd.ReDraw
    End If 
End If 

End Sub
Parents
  • I copied it in and replaced the entire script. But it didn't work. Here's what the PC-DMIS program looks like. Maybe it's something there.

    CS1 =SCRIPT/FILENAME= C:\CMM\SCRIPTS\MENU.BAS
    FUNCTION/Main,SHOW=YES,,
    STARTSCRIPT/
    ENDSCRIPT/
    ASSIGN/TYPE=0
    ASSIGN/ST1=0
    ASSIGN/ST2=0
    ASSIGN/ST3=0
    ASSIGN/ST4=0
    ASSIGN/WO=0

    Is there a setting or anything I need to do to enable scripts?
Reply
  • I copied it in and replaced the entire script. But it didn't work. Here's what the PC-DMIS program looks like. Maybe it's something there.

    CS1 =SCRIPT/FILENAME= C:\CMM\SCRIPTS\MENU.BAS
    FUNCTION/Main,SHOW=YES,,
    STARTSCRIPT/
    ENDSCRIPT/
    ASSIGN/TYPE=0
    ASSIGN/ST1=0
    ASSIGN/ST2=0
    ASSIGN/ST3=0
    ASSIGN/ST4=0
    ASSIGN/WO=0

    Is there a setting or anything I need to do to enable scripts?
Children
No Data