Custom Comment Script, upgraded

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Custom Comment Script, upgraded

    I have a version of this script hooked to a custom icon so with one-click I can run it and add comments quickly, or add canned (standadized) comments quickly.

    Credit goes to Nate on the other forum.

    I've modified it 10,000 times to suit my whims of whatever silly text character strings I like to add. My personal version has 13 different canned $$ comments.

    One thing I noticed that could be construed as a bug:
    If in your PC-DMIS program you have a $$ comment that you want to show on the report, you may toggle it from NO to YES.

    However once you do that, any subsequent $$ comments you add with the BAS all default to YES display on the report.

    So I fixed it.

    Also new is a Form Feed checkbox to space your report out alot.

    Code:
    'Custom Comment Script
    Sub Main()
    
    Dim buttonval As Integer
    
    Dim App As Object
    Set App = CreateObject("PCDLRN.Application")
    
    Dim Part As Object
    Set Part = App.ActivePartProgram
    
    Dim Cmds As Object
    Set Cmds = Part.Commands
    
    Dim PartProg As Object
    Set PartProg = App.ActivePartProgram
    
    Dim Cmd As Object
    
    Begin Dialog DLG_REPORT_COMMENT 50, 32, 290, 300, "What Comments Do You Need?"
    
    
    OKButton 225, 175, 50, 25
    
    
    
    CheckBox 12, 10, 150, 8, "$$ THAT COMMENT YOU ALWAYS USE", .CheckBox1
    
    CheckBox 205, 10, 60, 8, "FORM FEED", .CheckBox13
    
    
    Text 12, 35, 120, 8, "Custom $$ Comment:"
    TextBox 15, 45, 180, 12, .EditBox13
    TextBox 15, 55, 180, 12, .EditBox14
    TextBox 15, 65, 180, 12, .EditBox15
    
    Text 12, 85, 125, 8, "Custom Report Comment:"
    TextBox 15, 95, 180, 12, .EditBox1
    TextBox 15, 105, 180, 12, .EditBox2
    TextBox 15, 115, 180, 12, .EditBox3
    
    Text 12, 135, 125, 8, "Custom Operator Comment:"
    TextBox 15, 145, 180, 12, .EditBox23
    TextBox 15, 155, 180, 12, .EditBox24
    TextBox 15, 165, 180, 12, .EditBox25
    TextBox 15, 175, 180, 12, .EditBox26
    TextBox 15, 185, 180, 12, .EditBox27
    TextBox 15, 195, 180, 12, .EditBox28
    
    End Dialog
    
    '-------------------------------------------------------------------------------------------------------
    
    Dim dlg1 As DLG_REPORT_COMMENT
    buttonval = Dialog(dlg1)
    If button1 = 0 Then
    
    Dim customstr1 As String
    customstr1 = dlg1.EditBox1
    Dim lenstr1 As Integer
    lenstr1 = Len(dlg1.EditBox1)
    
    Dim customstr2 As String
    customstr2 = dlg1.EditBox2
    Dim lenstr2 As Integer
    lenstr2 = Len(dlg1.EditBox2)
    
    Dim customstr3 As String
    customstr3 = dlg1.EditBox3
    Dim lenstr3 As Integer
    lenstr3 = Len(dlg1.EditBox3)
    
    '
    
    Dim customstr13 As String
    customstr13 = dlg1.EditBox13
    Dim lenstr13 As Integer
    lenstr13 = Len(dlg1.EditBox13)
    
    Dim customstr14 As String
    customstr14 = dlg1.EditBox14
    Dim lenstr14 As Integer
    lenstr14 = Len(dlg1.EditBox14)
    
    Dim customstr15 As String
    customstr15 = dlg1.EditBox15
    Dim lenstr15 As Integer
    lenstr15 = Len(dlg1.EditBox15)
    
    '
    
    
    Dim customstr23 As String
    customstr23 = dlg1.EditBox23
    Dim lenstr23 As Integer
    lenstr23 = Len(dlg1.EditBox23)
    
    Dim customstr24 As String
    customstr24 = dlg1.EditBox24
    Dim lenstr24 As Integer
    lenstr24 = Len(dlg1.EditBox24)
    
    Dim customstr25 As String
    customstr25 = dlg1.EditBox25
    Dim lenstr25 As Integer
    lenstr25 = Len(dlg1.EditBox25)
    
    Dim customstr26 As String
    customstr26 = dlg1.EditBox26
    Dim lenstr26 As Integer
    lenstr26 = Len(dlg1.EditBox26)
    
    Dim customstr27 As String
    customstr27 = dlg1.EditBox27
    Dim lenstr27 As Integer
    lenstr27 = Len(dlg1.EditBox27)
    
    Dim customstr28 As String
    customstr28 = dlg1.EditBox28
    Dim lenstr28 As Integer
    lenstr28 = Len(dlg1.EditBox28)
    
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    
    If dlg1.CheckBox1 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    If dlg1.CheckBox1 = 1 Then
    retvaltype = Cmd.PutText("THAT COMMENT YOU ALWAYS USE", COMMENT_FIELD, 1)
    End If
    Cmd.ReDraw
    End If
    
    
    If dlg1.CheckBox13 = 1 Then
    Set Cmd = Cmds.Add(PRINT_FORM_FEED, TRUE)
    End If
    
    
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    If lenstr1 > 0 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("REPT", COMMENT_TYPE, 0)
    retvaltype = Cmd.PutText(customstr1, COMMENT_FIELD, 1)
    If lenstr2 > 0 Then
    retvaltype = Cmd.PutText(customstr2, COMMENT_FIELD, 2)
    End If
    If lenstr3 > 0 Then
    retvaltype = Cmd.PutText(customstr3, COMMENT_FIELD, 3)
    End If
    Cmd.ReDraw
    End If
    
    If lenstr13 > 0 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText(customstr13, COMMENT_FIELD, 1)
    If lenstr14 > 0 Then
    retvaltype = Cmd.PutText(customstr14, COMMENT_FIELD, 2)
    End If
    If lenstr15 > 0 Then
    retvaltype = Cmd.PutText(customstr15, COMMENT_FIELD, 3)
    End If
    Cmd.ReDraw
    End If
    
    
    If lenstr23 > 0 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("OPER", COMMENT_TYPE, 0)
    retvaltype = Cmd.PutText(customstr23, COMMENT_FIELD, 1)
    If lenstr24 > 0 Then
    retvaltype = Cmd.PutText(customstr24, COMMENT_FIELD, 2)
    End If
    If lenstr25 > 0 Then
    retvaltype = Cmd.PutText(customstr25, COMMENT_FIELD, 3)
    End If
    If lenstr26 > 0 Then
    retvaltype = Cmd.PutText(customstr26, COMMENT_FIELD, 4)
    End If
    If lenstr27 > 0 Then
    retvaltype = Cmd.PutText(customstr27, COMMENT_FIELD, 5)
    End If
    If lenstr28 > 0 Then
    retvaltype = Cmd.PutText(customstr28, COMMENT_FIELD, 6)
    End If
    Cmd.ReDraw
    End If
    
    End If
    End Sub



    To add a script to a custom icon:
    Right-click on toolbar area
    Select customize

    On left-most tab "Menu", click on Create Item
    Use the ... button to navigate to where the BAS is stored
    It won't show up - you gotta toggle the Files Of Type to Basic Script
    Choose it
    Now there's a Change Icon buton too, google free icons there's a bazillion out there.

    Now go to Toolbars tab
    There click on New then Toolbar
    Now you can Add your new Item to your new toolbar from the bottom-most User Defined Commands.

    Done.

    Profit.
    Last edited by Josh Carpenter; 03-26-2012, 03:41 PM.
    Help with PC-DMIS:
    1. Search Forum. If nothing then:
    2. Post new thread - title clearly referring to problem.
    3. Listen & learn.
    No PMs please

  • #2
    Thanks for sharing!
    PC-DMIS CAD++ 2o16.0 SP5

    Comment


    • #3
      Fixing the $$ Comment toggle to YES/NO?

      Hi Josh,
      I've just encountered the $$ toggling to YES after I used a BAS button (to add autosave writing to pdf with date/time/filehedr).
      You said you fixed this behaviour - what bit of your code do I need? I want all $$ to always be NO.
      Thanks
      Mark

      Comment


      • #4
        I did a total revamp, adding some new bells and whistles and cleaning up the layout.
        Had to chop this up into several posts, 10k character limit slays me.
        Code:
        '______________________ CUSTOM COMMENTS ___________________________________________________________
        '                v8, Josh Carpenter April 3013
        'TOTALLY FREE OPEN SOURCE CODE NO TRADEMARK OR COPYRIGHT WHATSOEVER
        'NO WARRANTY OR GUARANTEE IMPLIED OR SPECIFIED
        'ONLY FOR USE WITH PC-DMIS SOFTWARE copyright Wilcox Associates
        
        'Version 8 addes the ability to create and use one new 'canned' comment.
        ' It requires system permission to write a text file to C:\TEMP
        ' Only one new canned comment is possible, and will be overwritten
        ' by selecting "make this a New Canned Comment" checkbox.
         
        Sub Main()
        Dim buttonval As Integer
        Dim App As Object
        Set App = CreateObject("PCDLRN.Application")
        Dim Part As Object
        Set Part = App.ActivePartProgram
        Dim Cmds As Object
        Set Cmds = Part.Commands
        Dim PartProg As Object
        Set PartProg = App.ActivePartProgram
        Dim Cmd As Object
        
        Begin Dialog DLG_REPORT_COMMENT 50, 32, 415, 350, "What Comments Do You Need?"
        
        CheckBox 10, 7, 40, 8, "$$ <>", .CheckBox1
        CheckBox 50, 7, 40, 8, "$$ |", .CheckBoX8
        CheckBox 90, 7, 50, 8, "$$ - - - - -", .CheckBox5
        CheckBox 150, 7, 40, 8, "$$ /\/\/\", .CheckBox14
        
        CheckBox 10, 35, 50, 8, "$$ \\\ Slope", .CheckBox2
        CheckBox 10, 48, 50, 8, "$$ /// Slope", .CheckBox3
        
        CheckBox 80, 35, 50, 8, "$$ ||| Slope", .CheckBox9
        CheckBox 80, 48, 50, 8, "$$ ||| Slope", .CheckBox10
        
        CheckBox 150, 35, 50, 8, "$$ >>>>>", .CheckBox6
        CheckBox 150, 48, 50, 8, "$$ <<<<<", .CheckBox7
        
        CheckBox 130, 65, 30, 8, "$$ \ ", .CheckBox15
          Text   140, 73, 27, 8, "     /"
        
        CheckBox 170, 65, 40, 8, "$$ / ", .CheckBox16
          Text   180, 73, 27, 8, "     \"
        
        CheckBox 130, 90, 30, 8, "$$ \\\", .CheckBox19
            Text 150, 98, 20, 8, "///"
            Text 150, 106, 20, 8, "\\\"
        
        CheckBox 170, 90, 40, 8, "$$ ///", .CheckBox20
            Text 190, 98, 20, 8, "\\\"
            Text 190, 106, 20, 8, "///"
        
        CheckBox 150, 21, 50, 8, "$$ ~", .CheckBox17
        
        CheckBox 10, 21, 100, 8, "$$ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", .CheckBox18
        
        CheckBox 10, 65, 105, 8, "$$ !!! WARNING MOVE ALL !!!", .CheckBox11
        
        CheckBox 10, 78, 115, 8, "$$ _-_-_- PROBE CHANGE -_-_-_", .CheckBox12
        
        CheckBox 10, 92, 100, 8, "$$ ||| DIMENSIONS |||", .CheckBox4
        
        
        
        GroupBox 208, 3, 195,190
        GroupBox 206, 1, 199,194
        GroupBox 208, 3, 84,20
            Text 212, 10, 70, 8, "Custom $$ Comment:"
        CheckBox 320, 15, 70, 8, "NOTE:", .CheckBox7071
        CheckBox 212, 25, 135, 8, "$$ - - - - Program Revision Record - - - -", .CheckBoxE36
        Text     222, 35, 50, 8, "Created by:"
        TextBox 265, 35, 100, 10, .EditBoxE36
        CheckBox 212, 50, 145, 8, "$$ - - - - SETUP INSTRUCTIONS - - - -", .CheckBoxE46
        TextBox 215, 65, 180, 12, .EditBox13
        TextBox 215, 75, 180, 12, .EditBox14
        TextBox 215, 85, 180, 12, .EditBox15
        TextBox 215, 95, 180, 12, .EditBox16
        TextBox 215, 105, 180, 12, .EditBox17
        TextBox 215, 115, 180, 12, .EditBox18
        TextBox 215, 125, 180, 12, .EditBox19
        TextBox 215, 135, 180, 12, .EditBox20
        TextBox 215, 145, 180, 12, .EditBox21
        CheckBox 220, 165, 150, 8, "Make this a New Canned Comment", .CheckBox7072
        CheckBox 230, 180, 160, 8, "Use previously created New Canned Comment", .CheckBox7073
        
        
        GroupBox 8, 138,190,130
        GroupBox 6, 136,194,134
        GroupBox 8, 138, 70,20
        Text    12, 145, 65, 8, "Operator Comment:"
        CheckBox 90, 148, 70, 8, "CLICK OK, THEN...", .CheckBox2327
        TextBox 15, 160, 180, 12, .EditBox23
        TextBox 15, 170, 180, 12, .EditBox24
        TextBox 15, 180, 180, 12, .EditBox25
        TextBox 15, 190, 180, 12, .EditBox26
        TextBox 15, 200, 180, 12, .EditBox27
        TextBox 15, 210, 180, 12, .EditBox28
        CheckBox 120, 223, 70, 8, "... THEN CLICK OK", .CheckBox2328
         GroupBox 8,233,190,35
        CheckBox 20, 240, 65, 8, "Yes/No Question", .CheckBox2329
        CheckBox 120, 240, 65, 8, "Operator Input", .CheckBox2330
            Text 20, 252, 70, 8, "Required ID:"
        TextBox 70, 250, 80, 12, .EditBox29
        
        
        
        GroupBox 206, 206,199,124
        GroupBox 208, 208,195,120
        GroupBox 208, 208, 90,20
           Text 212, 215, 85, 8, "Custom Report Comment:"
           Text 320, 220, 80, 8, "Special Chars Brackets"
        Textbox 330, 230, 65, 8, .EditBox95
        CheckBox 220, 230, 80, 8, "SPACE LINE BEFORE", .CheckBox9193
         TextBox 215, 240, 180, 12, .EditBox91
         TextBox 215, 250, 180, 12, .EditBox92
         TextBox 215, 260, 180, 12, .EditBox93
        CheckBox 220, 275, 80, 8, "SPACE LINE AFTER", .CheckBox9194
        CheckBox 320, 275, 80, 8, "1-LINE BLANK", .CheckBox9195
        
             Text 215, 290, 50, 10, "Page #:"
          Textbox 245, 290, 40, 10, .Editbox202
        CheckBox 305, 290, 60, 8, "FORM FEED", .CheckBox133
             Text 230, 300, 140, 10, "View/Section/Detail:"
          Textbox 245, 310, 110, 10, .Editbox201
        
        
        
          GroupBox 13,296,88,38
          GroupBox 15,298,84,34
          GroupBox 17,300,80,30
              Text 22, 305, 70, 10, "# of Times to Repeat:"
           Textbox 45, 315, 20, 10, .Editbox650
        
        
        OKButton 135, 305, 50, 25
        
        End Dialog
        
        
        
        
        
        '-------------------------------------------------------------------------------------------------------
        ' Begin Actions Based on Inputs
        '-------------------------------------------------------------------------------------------------------
        
        Dim dlg1 As DLG_REPORT_COMMENT
        buttonval = Dialog(dlg1)
        
        
        Dim Repeater as Integer
        Repeater = dlg1.EditBox650
        
        Dim LR As Integer
        LR = Len(dlg1.EditBox650)
        
        If LR > 0 Then
        Repeater = dlg1.EditBox650
        End If
        
        If LR = 0 Then
        Repeater = 1
        End If
        
        
        '---------------------- LOOP FOR # OF TIMES TO REPEAT OPTION -------------------
        Do While Repeater > 0
        Help with PC-DMIS:
        1. Search Forum. If nothing then:
        2. Post new thread - title clearly referring to problem.
        3. Listen & learn.
        No PMs please

        Comment


        • #5
          Code:
          '-------  SECTION A: CANNED COMMENTS -----------------------
          If dlg1.CheckBox1 = 1 Then
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText("<>", COMMENT_FIELD, 1)
          Cmd.ReDraw
          End If
          '------------------------------
          If dlg1.CheckBox2 = 1 Then
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText("\", COMMENT_FIELD, 1)
          retvaltype = Cmd.PutText("\\", COMMENT_FIELD, 2)
          retvaltype = Cmd.PutText("\\\", COMMENT_FIELD, 3)
          Cmd.ReDraw
          End If
          '------------------------------
          If dlg1.CheckBox3 = 1 Then
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText("///", COMMENT_FIELD, 1)
          retvaltype = Cmd.PutText("//", COMMENT_FIELD, 2)
          retvaltype = Cmd.PutText("/", COMMENT_FIELD, 3)
          Cmd.ReDraw
          End If
          '------------------------------
          If dlg1.CheckBox4 = 1 Then
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText("||||||||||||||||||||||||||||||||||||||||||||||||||||", COMMENT_FIELD, 1)
          retvaltype = Cmd.PutText("                      DIMENSIONS                     ", COMMENT_FIELD, 2)
          retvaltype = Cmd.PutText("||||||||||||||||||||||||||||||||||||||||||||||||||||", COMMENT_FIELD, 3)
          Cmd.ReDraw
          End If
          '------------------------------
          If dlg1.CheckBox5 = 1 Then
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText("-----", COMMENT_FIELD, 1)
          Cmd.ReDraw
          End If
          '------------------------------
          If dlg1.CheckBox6 = 1 Then
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText(">>>>>", COMMENT_FIELD, 1)
          Cmd.ReDraw
          End If
          '------------------------------
          If dlg1.CheckBox7 = 1 Then
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText(">>>>>", COMMENT_FIELD, 1)
          Cmd.ReDraw
          End If
          '------------------------------
          If dlg1.CheckBox8 = 1 Then
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText("|", COMMENT_FIELD, 1)
          retvaltype = Cmd.PutText("|", COMMENT_FIELD, 2)
          retvaltype = Cmd.PutText("|", COMMENT_FIELD, 3)
          Cmd.ReDraw
          End If
          '------------------------------
          If dlg1.CheckBox9 = 1 Then
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText("|", COMMENT_FIELD, 1)
          retvaltype = Cmd.PutText("||", COMMENT_FIELD, 2)
          retvaltype = Cmd.PutText("|||", COMMENT_FIELD, 3)
          Cmd.ReDraw
          End If
          '------------------------------
          If dlg1.CheckBox10 = 1 Then
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText("|||", COMMENT_FIELD, 1)
          retvaltype = Cmd.PutText("||", COMMENT_FIELD, 2)
          retvaltype = Cmd.PutText("|", COMMENT_FIELD, 3)
          Cmd.ReDraw
          End If
          '------------------------------
          If dlg1.CheckBox11 = 1 Then
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText("!!!!!!!!!!!!!!!!!!! WARNING MOVE ALL !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", COMMENT_FIELD, 1)
          Cmd.ReDraw
          End If
          '------------------------------
          If dlg1.CheckBox12 = 1 Then
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText("_-_-_-_-_-_-_-_-_-_-_- PROBE CHANGE -_-_-_-_-_-_-_-_-_-_-_-_-", COMMENT_FIELD, 1)
          Cmd.ReDraw
          End If
          '------------------------------
          If dlg1.CheckBox14 = 1 Then
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText("^^^", COMMENT_FIELD, 1)
          Cmd.ReDraw
          End If
          
          '------------------------------
          If dlg1.CheckBox15 = 1 Then
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText("\", COMMENT_FIELD, 1)
          retvaltype = Cmd.PutText(" \", COMMENT_FIELD, 2)
          retvaltype = Cmd.PutText("  \", COMMENT_FIELD, 3)
          Cmd.ReDraw
          
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText("  /", COMMENT_FIELD, 1)
          retvaltype = Cmd.PutText(" /", COMMENT_FIELD, 2)
          retvaltype = Cmd.PutText("/", COMMENT_FIELD, 3)
          Cmd.ReDraw
          End If
          '------------------------------
          If dlg1.CheckBox16 = 1 Then
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText("  /", COMMENT_FIELD, 1)
          retvaltype = Cmd.PutText(" /", COMMENT_FIELD, 2)
          retvaltype = Cmd.PutText("/", COMMENT_FIELD, 3)
          Cmd.ReDraw
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText("\", COMMENT_FIELD, 1)
          retvaltype = Cmd.PutText(" \", COMMENT_FIELD, 2)
          retvaltype = Cmd.PutText("  \", COMMENT_FIELD, 3)
          End If
          '------------------------------
          If dlg1.CheckBox17 = 1 Then
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText("~", COMMENT_FIELD, 1)
          Cmd.ReDraw
          End If
          '------------------------------
          If dlg1.CheckBox18 = 1 Then
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", COMMENT_FIELD, 1)
          Cmd.ReDraw
          End If
          '------------------------------
          If dlg1.CheckBox19 = 1 Then
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText("\\\", COMMENT_FIELD, 1)
          retvaltype = Cmd.PutText(" \\\", COMMENT_FIELD, 2)
          retvaltype = Cmd.PutText("  \\\", COMMENT_FIELD, 3)
          retvaltype = Cmd.PutText("  ///", COMMENT_FIELD, 4)
          retvaltype = Cmd.PutText(" ///", COMMENT_FIELD, 5)
          retvaltype = Cmd.PutText("///", COMMENT_FIELD, 6)
          retvaltype = Cmd.PutText("\\\", COMMENT_FIELD, 7)
          retvaltype = Cmd.PutText(" \\\", COMMENT_FIELD, 8)
          retvaltype = Cmd.PutText("  \\\", COMMENT_FIELD, 9)
          Cmd.ReDraw
          End If
          '------------------------------
          If dlg1.CheckBox20 = 1 Then
          Set Cmd = Cmds.Add(SET_COMMENT, True)
          retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
          retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
          retvaltype = Cmd.PutText("  ///", COMMENT_FIELD, 1)
          retvaltype = Cmd.PutText(" ///", COMMENT_FIELD, 2)
          retvaltype = Cmd.PutText("///", COMMENT_FIELD, 3)
          retvaltype = Cmd.PutText("\\\", COMMENT_FIELD, 4)
          retvaltype = Cmd.PutText(" \\\", COMMENT_FIELD, 5)
          retvaltype = Cmd.PutText("  \\\", COMMENT_FIELD, 6)
          retvaltype = Cmd.PutText("  ///", COMMENT_FIELD, 7)
          retvaltype = Cmd.PutText(" ///", COMMENT_FIELD, 8)
          retvaltype = Cmd.PutText("///", COMMENT_FIELD, 9)
          Cmd.ReDraw
          End If
          '------------------------------
          Help with PC-DMIS:
          1. Search Forum. If nothing then:
          2. Post new thread - title clearly referring to problem.
          3. Listen & learn.
          No PMs please

          Comment


          • #6
            Code:
            
            
            '- - - - CUSTOM $$ DOCUMENT COMMENT ------------------------------
            '     handling:
            Dim customstr13 As String
            customstr13 = dlg1.EditBox13
            Dim lenstr13 As Integer
            lenstr13 = Len(dlg1.EditBox13)
            
            Dim customstr14 As String
            customstr14 = dlg1.EditBox14
            Dim lenstr14 As Integer
            lenstr14 = Len(dlg1.EditBox14)
            
            Dim customstr15 As String
            customstr15 = dlg1.EditBox15
            Dim lenstr15 As Integer
            lenstr15 = Len(dlg1.EditBox15)
            
            Dim customstr16 As String
            customstr16 = dlg1.EditBox16
            Dim lenstr16 As Integer
            lenstr16 = Len(dlg1.EditBox16)
            
            Dim customstr17 As String
            customstr17 = dlg1.EditBox17
            Dim lenstr17 As Integer
            lenstr17 = Len(dlg1.EditBox17)
            
            Dim customstr18 As String
            customstr18 = dlg1.EditBox18
            Dim lenstr18 As Integer
            lenstr18 = Len(dlg1.EditBox18)
            
            Dim customstr19 As String
            customstr19 = dlg1.EditBox19
            Dim lenstr19 As Integer
            lenstr19 = Len(dlg1.EditBox19)
            
            Dim customstr20 As String
            customstr20 = dlg1.EditBox20
            Dim lenstr20 As Integer
            lenstr20 = Len(dlg1.EditBox20)
            
            Dim customstr21 As String
            customstr21 = dlg1.EditBox21
            Dim lenstr21 As Integer
            lenstr21 = Len(dlg1.EditBox21)
            
            Dim customstrE36 As String
            customstrE36 = dlg1.EditBoxE36
            Dim lenstrE36 As Integer
            lenstrE36 = Len(dlg1.EditBoxE36)
            
            
            '- - - - CUSTOM $$ DOCUMENT COMMENT, Setup Instructions  ------------------------------
            If dlg1.CheckBoxE46 = 1 Then
            Set Cmd = Cmds.Add(SET_COMMENT, True)
            retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
            retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
            
             If dlg1.CheckBoxE46 = 1  Then
            retvaltype = Cmd.PutText("------------ Setup Instructions ----------------------------------------------------------------", COMMENT_FIELD, 1)
             End If
            
             If lenstr13 = 0 Then
             retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 2)
            retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 3)
             End If
            
             If lenstr13 > 0 Then
             retvaltype = Cmd.PutText(customstr13, COMMENT_FIELD, 2)
             End If
            
             If lenstr14 = 0 And lenstr13 > 0 Then
             retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 3)
            retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 4)
             End If
            
             If lenstr14 > 0 Then
             retvaltype = Cmd.PutText(customstr14, COMMENT_FIELD, 3)
             End If
            
             If lenstr15 = 0 And lenstr14 > 0 Then
             retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 4)
            retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 5)
             End If
            
             If lenstr15 > 0 Then
             retvaltype = Cmd.PutText(customstr15, COMMENT_FIELD, 4)
             End If
            
             If lenstr16 = 0 And lenstr15 > 0 Then
             retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 5)
            retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 6)
             End If
            
             If lenstr16 > 0 Then
             retvaltype = Cmd.PutText(customstr16, COMMENT_FIELD, 5)
             End If
            
             If lenstr17 = 0 And lenstr16 > 0 Then
             retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 6)
            retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 7)
             End If
            
             If lenstr17 > 0 Then
             retvaltype = Cmd.PutText(customstr17, COMMENT_FIELD, 6)
             End If
            
             If lenstr18 = 0 And lenstr17 > 0 Then
             retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 7)
            retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 8)
             End If
            
             If lenstr18 > 0 Then
             retvaltype = Cmd.PutText(customstr18, COMMENT_FIELD, 7)
             End If
            
             If lenstr19 = 0 And lenstr18 > 0 Then
             retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 8)
            retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 9)
             End If
            
             If lenstr19 > 0 Then
             retvaltype = Cmd.PutText(customstr19, COMMENT_FIELD, 8)
             End If
            
             If lenstr20 = 0 And lenstr19 > 0 Then
             retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 9)
            retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 10)
             End If
            
             If lenstr20 > 0 Then
             retvaltype = Cmd.PutText(customstr20, COMMENT_FIELD, 9)
             End If
            
             If lenstr21 = 0 And lenstr20 > 0 Then
             retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 10)
            retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 11)
             End If
            
             If lenstr21 > 0 Then
             retvaltype = Cmd.PutText(customstr21, COMMENT_FIELD, 10)
             retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 11)
            retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 12)
             End If
            
             End If
            
            
            '- - - - CUSTOM $$ DOCUMENT COMMENT, Program Revisions  ------------------------------
            If dlg1.CheckBoxE36 = 1 Then
            Set Cmd = Cmds.Add(SET_COMMENT, True)
            retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
            retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
            retvaltype = Cmd.PutText("------------ Program Revision Record ----------------------------------------------------------------", COMMENT_FIELD, 1)
            retvaltype = Cmd.PutText("Created by "+customstrE36, COMMENT_FIELD, 2)
            
             If lenstr13 = 0 Then
             retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 2)
            retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 3)
             End If
            
             If lenstr13 > 0 Then
             retvaltype = Cmd.PutText(customstr13, COMMENT_FIELD, 2)
             End If
            
             If lenstr14 = 0 And lenstr13 > 0 Then
             retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 3)
            retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 4)
             End If
            
             If lenstr14 > 0 Then
             retvaltype = Cmd.PutText(customstr14, COMMENT_FIELD, 3)
             End If
            
             If lenstr15 = 0 And lenstr14 > 0 Then
             retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 4)
            retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 5)
             End If
            
             If lenstr15 > 0 Then
             retvaltype = Cmd.PutText(customstr15, COMMENT_FIELD, 4)
             End If
            
             If lenstr16 = 0 And lenstr15 > 0 Then
             retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 5)
            retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 6)
             End If
            
             If lenstr16 > 0 Then
             retvaltype = Cmd.PutText(customstr16, COMMENT_FIELD, 5)
             End If
            
             If lenstr17 = 0 And lenstr16 > 0 Then
             retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 6)
            retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 7)
             End If
            
             If lenstr17 > 0 Then
             retvaltype = Cmd.PutText(customstr17, COMMENT_FIELD, 6)
             End If
            
             If lenstr18 = 0 And lenstr17 > 0 Then
             retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 7)
            retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 8)
             End If
            
             If lenstr18 > 0 Then
             retvaltype = Cmd.PutText(customstr18, COMMENT_FIELD, 7)
             End If
            
             If lenstr19 = 0 And lenstr18 > 0 Then
             retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 8)
            retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 9)
             End If
            
             If lenstr19 > 0 Then
             retvaltype = Cmd.PutText(customstr19, COMMENT_FIELD, 8)
             End If
            
             If lenstr20 = 0 And lenstr19 > 0 Then
             retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 9)
            retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 10)
             End If
            
             If lenstr20 > 0 Then
             retvaltype = Cmd.PutText(customstr20, COMMENT_FIELD, 9)
             End If
            
             If lenstr21 = 0 And lenstr20 > 0 Then
             retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 10)
            retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 11)
             End If
            
             If lenstr21 > 0 Then
             retvaltype = Cmd.PutText(customstr21, COMMENT_FIELD, 10)
             retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 11)
            retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 12)
             End If
            
             End If
            Help with PC-DMIS:
            1. Search Forum. If nothing then:
            2. Post new thread - title clearly referring to problem.
            3. Listen & learn.
            No PMs please

            Comment


            • #7
              Code:
              
              '- - - - CUSTOM $$ DOCUMENT COMMENT, no options except "NOTE:" ------------------------------
              If lenstr13 > 0 And dlg1.CheckBoxE36 = 0 And dlg1.CheckBoxE46 = 0 Then
              Set Cmd = Cmds.Add(SET_COMMENT, True)
              retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
              retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
              
               If dlg1.Checkbox7071 = 1 Then
               retvaltype = Cmd.PutText("NOTE: " + customstr13, COMMENT_FIELD, 1)
               End If
              
               If dlg1.Checkbox7071 = 0 And dlg1.CheckBoxE36 = 0 And dlg1.CheckBoxE46 = 0 Then
               retvaltype = Cmd.PutText(customstr13, COMMENT_FIELD, 1)
               End If
              
               If lenstr14 > 0 Then
               retvaltype = Cmd.PutText(customstr14, COMMENT_FIELD, 2)
               End If
              
               If lenstr15 > 0 Then
               retvaltype = Cmd.PutText(customstr15, COMMENT_FIELD, 3)
               End If
              
               If lenstr16 > 0 Then
               retvaltype = Cmd.PutText(customstr16, COMMENT_FIELD, 4)
               End If
              
               If lenstr17 > 0 Then
               retvaltype = Cmd.PutText(customstr17, COMMENT_FIELD, 5)
               End If
              
               If lenstr18 > 0 Then
               retvaltype = Cmd.PutText(customstr18, COMMENT_FIELD, 6)
               End If
              
               If lenstr19 > 0 Then
               retvaltype = Cmd.PutText(customstr19, COMMENT_FIELD, 7)
               End If
              
               If lenstr20 > 0 Then
               retvaltype = Cmd.PutText(customstr20, COMMENT_FIELD, 8)
               End If
              
               If lenstr21 > 0 Then
               retvaltype = Cmd.PutText(customstr21, COMMENT_FIELD, 9)
               End If
              
                   If dlg1.Checkbox7072 = 1 Then
                    Open "C:\TEMP\NEWCANNED.txt" For Output As #1
                    print #1, customstr13
              
                     If lenstr14 > 0 Then
                     print #1, customstr14
                     End If
              
                     If lenstr15 > 0 Then
                     print #1, customstr15
                     End If
              
                     If lenstr16 > 0 Then
                     print #1, customstr16
                     End If
              
                     If lenstr17 > 0 Then
                     print #1, customstr17
                     End If
              
                     If lenstr18 > 0 Then
                     print #1, customstr18
                     End If
              
                     If lenstr19 > 0 Then
                     print #1, customstr19
                     End If
              
                     If lenstr20 > 0 Then
                     print #1, customstr20
                     End If
              
                     If lenstr21 > 0 Then
                     print #1, customstr21
                     End If
              
                    Close #1
                  End If
              
              Cmd.ReDraw
              End If
              
              
              '''''''''''' NEW CANNED COMMENT !$%%$^&#*^@%^!$%~%%^@^&^@$&*()_$*~!%!^% '''''''''''
                    If dlg1.Checkbox7073 = 1 Then
              Dim Line1 As String
              Dim Line2 As String
              Dim Line3 As String
              Dim Line4 As String
              Dim Line5 As String
              Dim Line6 As String
              Dim Line7 As String
              Dim Line8 As String
              Dim Line9 As String
              
                    Open "C:\TEMP\NEWCANNED.txt" For Input As #1
                    Line Input #1, Line1
                    Line Input #1, Line2
                    Line Input #1, Line3
                    Line Input #1, Line4
                    Line Input #1, Line5
                    Line Input #1, Line6
                    Line Input #1, Line7
                    Line Input #1, Line8
                    Line Input #1, Line9
                    Close #1
              
              Set Cmd = Cmds.Add(SET_COMMENT, True)
              retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
              retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
               retvaltype = Cmd.PutText(Line1, COMMENT_FIELD, 1)
               retvaltype = Cmd.PutText(Line2, COMMENT_FIELD, 2)
               retvaltype = Cmd.PutText(Line3, COMMENT_FIELD, 3)
               retvaltype = Cmd.PutText(Line4, COMMENT_FIELD, 4)
               retvaltype = Cmd.PutText(Line5, COMMENT_FIELD, 5)
               retvaltype = Cmd.PutText(Line6, COMMENT_FIELD, 6)
               retvaltype = Cmd.PutText(Line7, COMMENT_FIELD, 7)
               retvaltype = Cmd.PutText(Line8, COMMENT_FIELD, 8)
               retvaltype = Cmd.PutText(Line9, COMMENT_FIELD, 9)
              End If
              Help with PC-DMIS:
              1. Search Forum. If nothing then:
              2. Post new thread - title clearly referring to problem.
              3. Listen & learn.
              No PMs please

              Comment


              • #8
                Code:
                
                '- - - - CUSTOM OPERATOR COMMENTS  ------------------------------
                '         HANDLING
                Dim customstr23 As String
                customstr23 = dlg1.EditBox23
                Dim lenstr23 As Integer
                lenstr23 = Len(dlg1.EditBox23)
                
                Dim customstr24 As String
                customstr24 = dlg1.EditBox24
                Dim lenstr24 As Integer
                lenstr24 = Len(dlg1.EditBox24)
                
                Dim customstr25 As String
                customstr25 = dlg1.EditBox25
                Dim lenstr25 As Integer
                lenstr25 = Len(dlg1.EditBox25)
                
                Dim customstr26 As String
                customstr26 = dlg1.EditBox26
                Dim lenstr26 As Integer
                lenstr26 = Len(dlg1.EditBox26)
                
                Dim customstr27 As String
                customstr27 = dlg1.EditBox27
                Dim lenstr27 As Integer
                lenstr27 = Len(dlg1.EditBox27)
                
                Dim customstr28 As String
                customstr28 = dlg1.EditBox28
                Dim lenstr28 As Integer
                lenstr28 = Len(dlg1.EditBox28)
                
                Dim customstr29 As String
                customstr29 = dlg1.EditBox29
                Dim lenstr29 As Integer
                lenstr29 = Len(dlg1.EditBox29)
                
                
                ' - - - - OPERATOR COMMENT:  USUAL CHECKBOX -----------
                If lenstr23 > 0 And dlg1.CheckBox2327 = 1 Then
                Set Cmd = Cmds.Add(SET_COMMENT, True)
                retvaltype = Cmd.PutText("OPER", COMMENT_TYPE, 0)
                
                retvaltype = Cmd.PutText("CLICK OK, THEN:", COMMENT_FIELD, 1)
                
                retvaltype = Cmd.PutText(customstr23, COMMENT_FIELD, 2)
                
                 If lenstr24 > 0 Then
                 retvaltype = Cmd.PutText(customstr24, COMMENT_FIELD, 3)
                 End If
                
                 If lenstr25 > 0 Then
                 retvaltype = Cmd.PutText(customstr25, COMMENT_FIELD, 4)
                 End If
                
                 If lenstr26 > 0 Then
                 retvaltype = Cmd.PutText(customstr26, COMMENT_FIELD, 5)
                 End If
                
                 If lenstr27 > 0 Then
                 retvaltype = Cmd.PutText(customstr27, COMMENT_FIELD, 6)
                 End If
                
                 If lenstr28 > 0 Then
                 retvaltype = Cmd.PutText(customstr28, COMMENT_FIELD, 7)
                 End If
                
                Cmd.ReDraw
                End If
                
                ' - - - - OPERATOR COMMENT:  ALTERNATE CHECKBOX -----------
                
                If lenstr23 > 0 And dlg1.CheckBox2328 = 1 Then
                Set Cmd = Cmds.Add(SET_COMMENT, True)
                retvaltype = Cmd.PutText("OPER", COMMENT_TYPE, 0)
                
                retvaltype = Cmd.PutText(customstr23, COMMENT_FIELD, 1)
                
                 If lenstr24 = 0 Then
                 retvaltype = Cmd.PutText("THEN CLICK OK.", COMMENT_FIELD, 2)
                 End If
                 If lenstr24 > 0 Then
                 retvaltype = Cmd.PutText(customstr24, COMMENT_FIELD, 2)
                 End If
                
                 If lenstr24 > 0 And lenstr25 = 0 Then
                 retvaltype = Cmd.PutText("THEN CLICK OK.", COMMENT_FIELD, 3)
                 End If
                 If lenstr25 > 0 Then
                 retvaltype = Cmd.PutText(customstr25, COMMENT_FIELD, 3)
                 End If
                
                 If lenstr25 > 0 And lenstr26 = 0 Then
                 retvaltype = Cmd.PutText("THEN CLICK OK.", COMMENT_FIELD, 4)
                 End If
                 If lenstr26 > 0 Then
                 retvaltype = Cmd.PutText(customstr26, COMMENT_FIELD, 4)
                 End If
                
                 If lenstr26 > 0 And lenstr27 = 0 Then
                 retvaltype = Cmd.PutText("THEN CLICK OK.", COMMENT_FIELD, 5)
                 End If
                 If lenstr27 > 0 Then
                 retvaltype = Cmd.PutText(customstr27, COMMENT_FIELD, 5)
                 End If
                
                 If lenstr27 > 0 And lenstr28 = 0 Then
                 retvaltype = Cmd.PutText("THEN CLICK OK.", COMMENT_FIELD, 6)
                 End If
                 If lenstr28 > 0 Then
                 retvaltype = Cmd.PutText(customstr28, COMMENT_FIELD, 6)
                 retvaltype = Cmd.PutText("THEN CLICK OK.", COMMENT_FIELD, 7)
                 End If
                
                Cmd.ReDraw
                End If
                
                ' - - - - OPERATOR COMMENT:  NO CHECKBOX -----------
                
                If lenstr23 > 0 And dlg1.CheckBox2328 = 0 And dlg1.CheckBox2327 = 0 And dlg1.CheckBox2329 = 0 And dlg1.CheckBox2330 = 0 Then
                Set Cmd = Cmds.Add(SET_COMMENT, True)
                retvaltype = Cmd.PutText("OPER", COMMENT_TYPE, 0)
                
                retvaltype = Cmd.PutText(customstr23, COMMENT_FIELD, 1)
                
                 If lenstr24 > 0 Then
                 retvaltype = Cmd.PutText(customstr24, COMMENT_FIELD, 2)
                 End If
                
                 If lenstr25 > 0 Then
                 retvaltype = Cmd.PutText(customstr25, COMMENT_FIELD, 3)
                 End If
                
                 If lenstr26 > 0 Then
                 retvaltype = Cmd.PutText(customstr26, COMMENT_FIELD, 4)
                 End If
                
                 If lenstr27 > 0 Then
                 retvaltype = Cmd.PutText(customstr27, COMMENT_FIELD, 5)
                 End If
                
                 If lenstr28 > 0 Then
                 retvaltype = Cmd.PutText(customstr28, COMMENT_FIELD, 6)
                 End If
                Cmd.ReDraw
                End If
                
                
                
                
                
                ' - - - - OPERATOR COMMENT:  YES/NO  -----------
                If lenstr23 > 0 And dlg1.CheckBox2329 = 1 And lenstr29 > 0 Then
                Set Cmd = Cmds.Add(SET_COMMENT, True)
                retvaltype = Cmd.PutText (customstr29, ID, 0)
                retvaltype = Cmd.SetToggleString (5, COMMENT_TYPE, 0)
                retvaltype = Cmd.PutText (customstr23, COMMENT_FIELD, 1)
                
                 If lenstr24 > 0 Then
                 retvaltype = Cmd.PutText(customstr24, COMMENT_FIELD, 2)
                 End If
                
                 If lenstr25 > 0 Then
                 retvaltype = Cmd.PutText(customstr25, COMMENT_FIELD, 3)
                 End If
                
                 If lenstr26 > 0 Then
                 retvaltype = Cmd.PutText(customstr26, COMMENT_FIELD, 4)
                 End If
                
                 If lenstr27 > 0 Then
                 retvaltype = Cmd.PutText(customstr27, COMMENT_FIELD, 5)
                 End If
                
                 If lenstr28 > 0 Then
                 retvaltype = Cmd.PutText(customstr28, COMMENT_FIELD, 6)
                 End If
                
                retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
                retvaltype = Cmd.SetToggleString (1, DISPLAY_TYPE, 0)
                retvaltype = Cmd.PutText ("NO", TIME_ARG, 0)
                retvaltype = Cmd.PutText ("0", T_VALUE, 0)
                End If
                
                
                
                ' - - - - OPERATOR COMMENT:  INPUT  -----------
                If lenstr23 > 0 And dlg1.CheckBox2330 = 1 And lenstr29 > 0 Then
                Set Cmd = Cmds.Add(SET_COMMENT, True)
                retvaltype = Cmd.PutText (customstr29, ID, 0)
                retvaltype = Cmd.SetToggleString (3, COMMENT_TYPE, 0)
                retvaltype = Cmd.PutText (customstr23, COMMENT_FIELD, 1)
                
                 If lenstr24 > 0 Then
                 retvaltype = Cmd.PutText(customstr24, COMMENT_FIELD, 2)
                 End If
                
                 If lenstr25 > 0 Then
                 retvaltype = Cmd.PutText(customstr25, COMMENT_FIELD, 3)
                 End If
                
                 If lenstr26 > 0 Then
                 retvaltype = Cmd.PutText(customstr26, COMMENT_FIELD, 4)
                 End If
                
                 If lenstr27 > 0 Then
                 retvaltype = Cmd.PutText(customstr27, COMMENT_FIELD, 5)
                 End If
                
                 If lenstr28 > 0 Then
                 retvaltype = Cmd.PutText(customstr28, COMMENT_FIELD, 6)
                 End If
                
                retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
                retvaltype = Cmd.SetToggleString (1, DISPLAY_TYPE, 0)
                retvaltype = Cmd.PutText ("NO", TIME_ARG, 0)
                retvaltype = Cmd.PutText ("0", T_VALUE, 0)
                End If
                Help with PC-DMIS:
                1. Search Forum. If nothing then:
                2. Post new thread - title clearly referring to problem.
                3. Listen & learn.
                No PMs please

                Comment


                • #9
                  Code:
                  
                  '- - - - - REPORT COMMENT handling --------------------------------------
                  
                  Dim customstr91 As String
                  Dim customstr92 As String
                  Dim customstr93 As String
                  Dim customstr94 As String
                  Dim customstr95 As String
                  Dim lenstr91 As Integer
                  Dim lenstr92 As Integer
                  Dim lenstr93 As Integer
                  Dim lenstr94 As Integer
                  Dim lenstr95 As Integer
                  
                  customstr95 = dlg1.EditBox95
                  lenstr95 = Len(dlg1.EditBox95)
                  
                  If lenstr95 > 0 Then
                   customstr91 = dlg1.EditBox95 + "   " + dlg1.EditBox91 + "   " + dlg1.EditBox95
                   lenstr91 = Len(dlg1.EditBox91)
                  
                   customstr92 = "       " + dlg1.EditBox92
                   lenstr92 = Len(dlg1.EditBox92)
                  
                   customstr93 = "       " + dlg1.EditBox93
                   lenstr93 = Len(dlg1.EditBox93)
                  
                  End If
                  
                  If lenstr95 = 0 Then
                   customstr91 = dlg1.EditBox91
                   lenstr91 = Len(dlg1.EditBox91)
                  
                   customstr92 = dlg1.EditBox92
                   lenstr92 = Len(dlg1.EditBox92)
                  
                   customstr93 = dlg1.EditBox93
                   lenstr93 = Len(dlg1.EditBox93)
                  
                  
                  End If
                  
                  '- - - - REPORT COMMENT, NO SPACELINES -----------
                  
                  If lenstr91 > 0 And dlg1.CheckBox9193 = 0 And dlg1.CheckBox9194 = 0 Then
                  Set Cmd = Cmds.Add(SET_COMMENT, True)
                  retvaltype = Cmd.PutText("REPT", COMMENT_TYPE, 0)
                  retvaltype = Cmd.PutText(customstr91, COMMENT_FIELD, 1)
                  
                   If lenstr92 > 0 Then
                   retvaltype = Cmd.PutText(customstr92, COMMENT_FIELD, 2)
                   End If
                  
                   If lenstr93 > 0 Then
                   retvaltype = Cmd.PutText(customstr93, COMMENT_FIELD, 3)
                   End If
                  
                   If lenstr94 > 0 Then
                   retvaltype = Cmd.PutText(customstr94, COMMENT_FIELD, 4)
                   End If
                  
                  Cmd.ReDraw
                  End If
                  
                  
                  
                  
                  '- - - - REPORT COMMENT, SPACELINE BEFORE ONLY -----------
                  
                  If lenstr91 > 0 And dlg1.CheckBox9193 = 1 And dlg1.CheckBox9194 = 0 Then
                  Set Cmd = Cmds.Add(SET_COMMENT, True)
                  retvaltype = Cmd.PutText("REPT", COMMENT_TYPE, 0)
                  retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 1)
                  retvaltype = Cmd.PutText(customstr91, COMMENT_FIELD, 2)
                  
                   If lenstr92 > 0 Then
                   retvaltype = Cmd.PutText(customstr92, COMMENT_FIELD, 3)
                   End If
                  
                   If lenstr93 > 0 Then
                   retvaltype = Cmd.PutText(customstr93, COMMENT_FIELD, 4)
                   End If
                  
                   If lenstr94 > 0 Then
                   retvaltype = Cmd.PutText(customstr94, COMMENT_FIELD, 5)
                   End If
                  
                  Cmd.ReDraw
                  End If
                  
                  
                  '- - - - REPORT COMMENT, SPACELINE AFTER ONLY -----------
                  
                  If lenstr91 > 0 And dlg1.CheckBox9193 = 0 And dlg1.CheckBox9194 = 1 Then
                  Set Cmd = Cmds.Add(SET_COMMENT, True)
                  retvaltype = Cmd.PutText("REPT", COMMENT_TYPE, 0)
                  
                  retvaltype = Cmd.PutText(customstr91, COMMENT_FIELD, 1)
                  
                   If lenstr92 = 0 Then
                   retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 2)
                   End If
                  
                   If lenstr92 > 0 Then
                   retvaltype = Cmd.PutText(customstr92, COMMENT_FIELD, 2)
                   End If
                   If lenstr92 > 0 And lenstr93 = 0 Then
                   retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 3)
                   End If
                  
                   If lenstr93 > 0 Then
                   retvaltype = Cmd.PutText(customstr93, COMMENT_FIELD, 3)
                   End If
                   If lenstr93 > 0 And lenstr94 = 0 Then
                   retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 4)
                   End If
                  
                   If lenstr94 > 0 Then
                   retvaltype = Cmd.PutText(customstr94, COMMENT_FIELD, 4)
                   retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 5)
                   End If
                  
                  Cmd.ReDraw
                  End If
                  
                  
                  '- - - - REPORT COMMENT, SPACELINE BEFORE AND AFTER -----------
                  
                  If lenstr91 > 0 And dlg1.CheckBox9193 = 1 And dlg1.CheckBox9194 = 1 Then
                  Set Cmd = Cmds.Add(SET_COMMENT, True)
                  retvaltype = Cmd.PutText("REPT", COMMENT_TYPE, 0)
                  retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 1)
                  
                  retvaltype = Cmd.PutText(customstr91, COMMENT_FIELD, 2)
                  
                   If lenstr92 = 0 Then
                   retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 3)
                   End If
                  
                   If lenstr92 > 0 Then
                   retvaltype = Cmd.PutText(customstr92, COMMENT_FIELD, 3)
                   End If
                   If lenstr92 > 0 And lenstr93 = 0 Then
                   retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 4)
                   End If
                  
                   If lenstr93 > 0 Then
                   retvaltype = Cmd.PutText(customstr93, COMMENT_FIELD, 4)
                   End If
                   If lenstr93 > 0 And lenstr94 = 0 Then
                   retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 5)
                   End If
                  
                   If lenstr94 > 0 Then
                   retvaltype = Cmd.PutText(customstr94, COMMENT_FIELD, 5)
                   retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 6)
                   End If
                  
                  Cmd.ReDraw
                  End If
                  
                  
                  
                  
                  '- - - - REPORT COMMENT, JUST ONE BLANK SPACELINE -----------
                  If dlg1.CheckBox9195 = 1 Then
                  Set Cmd = Cmds.Add(SET_COMMENT, True)
                   retvaltype = Cmd.PutText("REPT", COMMENT_TYPE, 0)
                   retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 1)
                  End If
                  
                  
                  
                  
                  
                  
                  
                  '- - - - OP AND PAGE #, PLUS FORM FEED ------------------------------
                  Dim customstr201 As String
                  customstr201 = dlg1.EditBox201
                  Dim lenstr201 As Integer
                  lenstr201 = Len(dlg1.EditBox201)
                  
                  Dim customstr202 As String
                  customstr202 = "PAGE " + dlg1.EditBox202
                  Dim lenstr202 As Integer
                  lenstr202 = Len(dlg1.EditBox202)
                  
                  Dim customstr203 As String
                  
                  If lenstr201 > 0 And lenstr202 >0 Then
                  customstr203 = "                                 " + customstr202 + "   " + customstr201
                  End IF
                  
                  If lenstr201 > 0 And lenstr202 =0 Then
                  customstr203 = "                                 " + customstr201
                  End IF
                  
                  If lenstr201 = 0 And lenstr202 >0 Then
                  customstr203 = "                                 " + customstr202
                  End IF
                  
                  If lenstr201 > 0 Or lenstr202 >0 Then
                     If dlg1.CheckBox133 = 1 Then
                     Set Cmd = Cmds.Add(SET_COMMENT, True)
                     retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
                     retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
                     retvaltype = Cmd.PutText("\", COMMENT_FIELD, 1)
                     retvaltype = Cmd.PutText("\\", COMMENT_FIELD, 2)
                     retvaltype = Cmd.PutText("\\\", COMMENT_FIELD, 3)
                  
                     Set Cmd = Cmds.Add(PRINT_FORM_FEED, TRUE)
                  
                     Set Cmd = Cmds.Add(SET_COMMENT, True)
                     retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
                     retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
                     retvaltype = Cmd.PutText("///", COMMENT_FIELD, 1)
                     retvaltype = Cmd.PutText("//", COMMENT_FIELD, 2)
                     retvaltype = Cmd.PutText("/", COMMENT_FIELD, 3)
                     End If
                  
                  Set Cmd = Cmds.Add(SET_COMMENT, True)
                  retvaltype = Cmd.PutText("REPT", COMMENT_TYPE, 0)
                  retvaltype = Cmd.PutText("   ", COMMENT_FIELD, 1)
                  retvaltype = Cmd.PutText("-------------------------------------------------------------------------------------------------------", COMMENT_FIELD, 2)
                  retvaltype = Cmd.PutText(customstr203, COMMENT_FIELD, 3)
                  retvaltype = Cmd.PutText("-------------------------------------------------------------------------------------------------------", COMMENT_FIELD, 4)
                  Cmd.ReDraw
                  End If
                  
                  
                  If dlg1.CheckBox133 = 1 And lenstr201=0 Then
                  Set Cmd = Cmds.Add(SET_COMMENT, True)
                  retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
                  retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
                  retvaltype = Cmd.PutText("\", COMMENT_FIELD, 1)
                  retvaltype = Cmd.PutText("\\", COMMENT_FIELD, 2)
                  retvaltype = Cmd.PutText("\\\", COMMENT_FIELD, 3)
                  Cmd.ReDraw
                  
                  Set Cmd = Cmds.Add(PRINT_FORM_FEED, TRUE)
                  
                  Set Cmd = Cmds.Add(SET_COMMENT, True)
                  retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
                  retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
                  retvaltype = Cmd.PutText("///", COMMENT_FIELD, 1)
                  retvaltype = Cmd.PutText("//", COMMENT_FIELD, 2)
                  retvaltype = Cmd.PutText("/", COMMENT_FIELD, 3)
                  Cmd.ReDraw
                  End If
                  
                  
                  '~~~~~~~~~~~~~~~~~~~~~~~~~~ END OF INPUTS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  
                  Repeater = Repeater-1
                  Loop
                  
                  
                  
                  End Sub
                  That's all of it.
                  Help with PC-DMIS:
                  1. Search Forum. If nothing then:
                  2. Post new thread - title clearly referring to problem.
                  3. Listen & learn.
                  No PMs please

                  Comment


                  • #10
                    Lovely!

                    <geek>
                    It reminds me of the ASCII-art in some IRC scripts...
                    </geek>
                    PC-DMIS CAD++ 2o16.0 SP5

                    Comment


                    • #11
                      Originally posted by vpt.se View Post
                      Lovely!

                      <geek>
                      It reminds me of the ASCII-art in some IRC scripts...
                      </geek>
                      If I was good I could make pictures, but I only make little squiggles.


                      Thoughts:
                      While I was copying and pasting it, the sheer length began to bug me and I realized that there is probably a dozen ways to compact the thing and make it more elegant. However, I used up too much time on it already and have work to do now.

                      Also, I got the "Make New Canned Comment" feature (suggested by my friend Wlayton) to work by writing to and reading from a text file in C:\Temp, but it only does one at a time and seems crude. How could this be done properly, by which I mean actually editing the script to add the new canned comment?
                      Help with PC-DMIS:
                      1. Search Forum. If nothing then:
                      2. Post new thread - title clearly referring to problem.
                      3. Listen & learn.
                      No PMs please

                      Comment


                      • #12
                        I'm not sure what "canned comment" means...

                        But appending stuff to a textfile isn't that hard?

                        Code:
                        Open "C:\proglog.txt" For Append As #1
                          Write #1, PCDPartProgram.Name & sstate & Date & " " & Time(Now)
                          Close #1
                        PC-DMIS CAD++ 2o16.0 SP5

                        Comment


                        • #13
                          Originally posted by vpt.se View Post
                          I'm not sure what "canned comment" means...
                          It means that you're working on a program where you need to add the same comment 20x, and don't want to type it every time, AND don't want to edit the BAS script to add it because this is probably the only program that's ever going to need this particular comment. So you type it it in once, check the "Make new canned comment" box, and from then on you can repeat it with the "Use new canned comment" checkbox.

                          Originally posted by vpt.se View Post
                          But appending stuff to a textfile isn't that hard?

                          Code:
                          Open "C:\proglog.txt" For Append As #1
                            Write #1, PCDPartProgram.Name & sstate & Date & " " & Time(Now)
                            Close #1
                          Correct, it wasn't hard - but in the modern Windows environment we are losing our abilities to freely write to things.
                          And I forgot to tell everyone that the script won't make a new directory called TEMP on your C:, so unless you do that manually then that option does not work.
                          I suppoose I could code up some sort of path-finding variable to fix that, perhaps future enhancement.

                          I was thinking more along the lines of trying to keep the actions self-contained within the BAS script, like the BAS being able to write the new input into itself and save it for later use.
                          Help with PC-DMIS:
                          1. Search Forum. If nothing then:
                          2. Post new thread - title clearly referring to problem.
                          3. Listen & learn.
                          No PMs please

                          Comment


                          • #14
                            I used the "canned comment" for several reasons. When completing a FAI our Quality Engineer makes a "Bubbled Print", I used the bubbled print and put those numbers before the dimension in the report with the "canned comment". This helps on several levels. 1. I can export to the FAI report (if I ever get the time). 2. From this point out our machinist can actually read the report when they match the bubble number comment on the report to the bubble on the "bubbled print". 3. Keeps my sanity when everyone isn't coming and asking me what this report means.
                            If there wasn't a wrong way, I would have no way at all.

                            Comment


                            • #15
                              'VERSION 14a: Added checkbox for complete "Dim List to CSV" script which exports a column-list of every non-NONE dimension to a CSV file in C:\Temp
                              Attached Files
                              Help with PC-DMIS:
                              1. Search Forum. If nothing then:
                              2. Post new thread - title clearly referring to problem.
                              3. Listen & learn.
                              No PMs please

                              Comment

                              Working...
                              X