here is a basic script for a simple operator login.
put these variables in the program after the script
Does anyone have any insight on how to store the last inputed information? be it a csv file or anything else.
Credit goes to the forum. I pieced it together.
Code:
Sub Main BeginDialog DIALOG_1 50,10, 300, 125, oOPERATORINPUT GroupBox 5,5,210,25 Text 20,15,85,12, "Enter Operator :" TextBox 85,13,50,12, .EditBox_1 GroupBox 5,35,210,25 Text 20,45,85,12, "Enter Job # :" TextBox 95,43,50,12, .EditBox_2 GroupBox 5,65,210,25 Text 20,75,85,12, "Enter Sample # :" TextBox 105,73,50,12, .EditBox_3 GroupBox 5,95,210,25 Text 20,105,85,12, "Shift # :" Text 50, 105,85,12, "1st" CheckBox 63,103,20,12, .CheckBox_1 Text 85, 105,85,12, "2nd" CheckBox 98,103,20,12, .CheckBox_2 Text 120, 105,85,12, "3rd" CheckBox 133,103,20,12, .CheckBox_3 OKButton 225,80,48,15 CancelButton 225,100,48,16 EndDialog Dim Dialg As DIALOG_1 button1 = Dialog(Dialg) Dim Progtype AsString If button1 = 0 Then Progtype= "END" Else Dim App, Part, Cmds, Cmd AsObject Set App = CreateObject("PCDLRN.Application") Set Part = App.ActivePartProgram Set Cmds = Part.Commands Dim Samp AsString Dim Shift AsString Oper = Dialg.EditBox_1 Job = Dialg.EditBox_2 Samp = Dialg.EditBox_3 shift_1 = Dialg.Checkbox_1 shift_2 = Dialg.Checkbox_2 shift_3 = Dialg.Checkbox_3 If shift_1 = 1 Then Shift = ("1st") End If If shift_2 = 1 Then Shift =("2nd") End If If shift_3 = 1 Then Shift =("3rd") End If EndIf ForEach Cmd In Cmds If Cmd.Type = ASSIGNMENT Then If Cmd.GetText(DEST_EXPR, 0) = "OPERATOR" Then bln = Cmd.PutText("""" + Oper + """", SRC_EXPR, 0) Cmd.ReDraw End If If Cmd.GetText(DEST_EXPR, 0) = "JOB" Then bln = Cmd.PutText("""" + Job + """", SRC_EXPR, 0) Cmd.ReDraw End If If Cmd.GetText(DEST_EXPR,0) = "SAMP" Then bln = Cmd.PutText("""" + Samp + """", SRC_EXPR, 0) Cmd.ReDraw End If If Cmd.GetText(DEST_EXPR,0) = "SHIFT" Then bln = Cmd.PutText("""" + Shift + """", SRC_EXPR, 0) Cmd.ReDraw End If End If Next Cmd EndSub
Code:
ASSIGN/OPERATOR = "Ryan" ASSIGN/JOB = "99999" ASSIGN/SAMP = "23" ASSIGN/SHIFT = "1st"
Credit goes to the forum. I pieced it together.
Comment