How to reset the input from operators

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

  • How to reset the input from operators

    Hi guys.

    I would like to force my colleagues to tip in some data every time the run a program.
    ex. their initials.
    In order to do so, I need to reset the value of the variable before the new window pops up.

    So, my question is:
    How can I reset the value of the 'Operator input', so that the 'Input Comment' window doesn't show the information from the last time the program was ran?


    This is what I have right now, and it keeps showing me the last initials



    ASSIGN/VAR_OPERATOR.INPUT=""
    VAR_OPERATOR =COMMENT/INPUT,NO,FULL SCREEN=NO,
    Your Initials - 3 characters please.
    IF/LEN(VAR_OPERATOR.INPUT) <> 3
    COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
    Initials must be 3 characters long!
    IF_GOTO/LEN(VAR_OPERATOR.INPUT)<>3,GOTO = OPR
    END_IF/
    COMMENT/REPT,
    "Operator ........... : "+VAR_OPERATOR.INPUT



    I know the answer is out there - somewhere :-)

    Best regards

    Michael
    -- o --
    PC-DMIS CAD Ver. 2019 R1 SP5
    DEA Global - 09-15-08
    Renishaw PH10MQ w/ TP200 & SCR200-Rack

  • #2
    F5 then check clear input on execution. This should take care of it.
    Last edited by BWIZZLE; 11-08-2017, 12:10 PM.

    Comment


    • #3
      Wonderful.
      I knew there was an easy answer to it.

      Thanks a lot.
      Best regards

      Michael
      -- o --
      PC-DMIS CAD Ver. 2019 R1 SP5
      DEA Global - 09-15-08
      Renishaw PH10MQ w/ TP200 & SCR200-Rack

      Comment


      • #4
        If you didn't want all comment inputs to be deleted, maybe because you need one of them. You can also use a very simple form with just an edit box, which will pass that text into a variable. A little more work but can also be useful.

        Comment


        • Mykel
          Mykel commented
          Editing a comment
          That was exactly what I wanted!
          The "F5-metode" has to be permanent, and blanks ALL of the inputs.
          That was not what I was looking for, but still a way to solve my problem.
          BUT...
          That raises another problem for me, cause I can't find a way to "reset" my variable, before my COMMET/OPER line.

          How do I reset my operator input?
          What is wrong with my first ASSIGN-line, since the initials from the previous operator keeps showing?
          The intension was to clear the input, but it doesn't work for me.

          OPR =LABEL/
          ASSIGN/VAR_OPERATOR.INPUT=""
          VAR_OPERATOR =COMMENT/INPUT,NO,FULL SCREEN=NO,
          Your Initials - 3 characters please.
          IF/LEN(VAR_OPERATOR.INPUT) <> 3
          COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
          Initials must be 3 characters long!
          IF_GOTO/LEN(VAR_OPERATOR.INPUT)<>3,GOTO = OPR
          END_IF/
          COMMENT/REPT,
          "Operator ........... : "+VAR_OPERATOR.INPUT

          How do you solve this puzzle in your programs?

      • #5
        Took me a few minutes to figure out what you had done, I think you have over complicated it slightly

        You have assigned a variable VAR_OPERATOR.INPUT

        Then you have an input comment called VAR_OPERATOR

        Then you are checking the length of the input in the comment by VAR_OPERATOR.INPUT. Problem is you now have two of those. Also you havn't sent the input from the first comment into a variable. Basically your assignment is in the wrong place and it needs to be named something different to the input comment (I think)

        Code:
        L1         =LABEL/
        C3         =COMMENT/INPUT,NO,FULL SCREEN=YES,
                    Your initials - three characters please
                    IF/LEN(C3.INPUT)<>3
                    COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
                    Initials must be three characters long
                    GOTO/L1
                    END_IF/
                    ASSIGN/V2=C3.INPUT
                    COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
                    "Operator............:"+V2
        I have replicated what you were looking for, and it works with the clear inputs on execution.

        Comment


        • Mykel
          Mykel commented
          Editing a comment
          I follow you.
          And You are right about the "Over-complicating"... That's me :-)
          Line-2 was for "resetting" the input-variable before asking for the new input, but it doesn't work.

          But what if "clear inputs on execution" is off?
          I want some of the other inputs to stay there until anything else is tipped in.
          That was the reason for my ASSIGN-line before the input-box.

          If I understand your example right, the input is cleared because of the F5-setting. Otherwise You'll have the last input standing there, and not a empty window.
          Correct me if I'm wrong.

        • bigtallanddopey
          bigtallanddopey commented
          Editing a comment
          Ah rite ok, yeh if the F5 setting is off the comment will still have the same information in it, and yes it will then still be in the variable.

          Unless anybody else knows an easier way the only way I know is to create a simple form that pops up and you enter the details in there. It then will need filling in every time.

          Go to View and then Form Editor, create a very simple form, consisting of a text box with your question, and an edit box. Then save it in the part program folder (that's easiest).

          if you then go to Insert > Report Command > Form, find where your form is kept and then make your code where it has been inserted look something like this ( I Think it is correct, Apologies if not) and you should be good to go.

          ASSIGN/V1=0
          CS1 =FORM/FILENAME= USERNAME.FORM
          PARAM/EDITBOX1.TEXT=V1
          PARAM/=
          ENDFORM/
          COMMENT/REPT,
          V1

          Hopefully that helps and Ive pointed u in the right direction, you will probably need to mess around with creating forms a few times to have them looking nice. There's also quite a bit in the help files which can help
          Last edited by bigtallanddopey; 02-20-2017, 08:49 AM.

      • #6
        Originally posted by BWIZZLE View Post
        F5 then check clear input on execution. This should take care of it.
        Is this a global setting? So all my programs with inputs will be cleared regardless if its created on the machine or offline?

        Edit: I tested this online and offline, its program specific. FYI.
        Last edited by acgarcia; 04-19-2017, 06:27 PM.

        Comment


        • #7
          Make the *.PRG file Read-Only in explorer. Don't allow them to save it.

          Comment


          • #8
            Ahhh I had this same scenario months ago and I didn't find a solution. I'm curious to see what the solution to your exact hurdle will be unfortunately for me if a solution does arise I wont get to apply it as I no longer write programs for 'human operators'.

            hope a gran master jedi offers up her/his solution...
            PcDmis 2015.1 SP10 CAD++
            Global 7-10-7 DC800S

            Comment


            • #9
              I cant find the script we used to have but it worked like this..... It was a bas file that had a box pop up... you entered in operator initials, shop# / lot# / serial number. If all 4 of these weren't satisfied the prg would automatically jump to a label at the end of the program ending the program. Sounds to me like this is what you are looking for..

              Comment


              • louisd
                louisd commented
                Editing a comment
                You could input a default comment value OPERATOR.
                Then you add a If/Goto statement.
                If_goto=comment.input == "OPERATOR", GOTO = label ID (label positioned before comment)


                this will restart comment input, forcing operator to input something other than default, before routine will continue.
                Save routine. Set as read only.

                done.

            • #10
              There's a zero script that DeWain Hodge wrote years ago....Give me a minute to find it and upload it.


              Edit: Found it. You'll need to change the extension from ".txt" to ".bas" then call it in your program.
              Attached Files
              Last edited by anthony.alfaro; 04-20-2017, 05:23 PM.
              Ex-Hex

              Comment


              • Mykel
                Mykel commented
                Editing a comment
                Hi Anthony.

                I had more or less given up on this issue.
                Your tip, and the attached file works just fine.

                It resets all the inputs. Not quite what I was looking for, but much better as my alternative.
                I go with this in my new version of template.

            Related Topics

            Collapse

            Working...
            X