hexagon logo

WHY if / end if control pair does not work with the form

I would like to start by apologizing for my bad english. Please understand.​

I'm using the 2018R2 version. I would like the operator to choose his production team, which would result in saving the report in the appropriate folder. I created a form and a conditional if statement. The problem is that​ the report is not saved after selecting a team.​


C1 =COMMENT/YESNO,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
Do you want to save the report ?
IF/C1.INPUT=="YES"
ASSIGN/OPTION1=0
ASSIGN/OPTION2=0
ASSIGN/OPTION3=0
CS1 =FORM/FILENAME= C:\MACHINE\REPORTS\FORM_1.FORM
PARAM/BUTTON1.CHECK=OPTION1
PARAM/BUTTON2.CHECK=OPTION2
PARAM/BUTTON3.CHECK=OPTION3
PARAM/=
ENDFORM/
IF/OPTION1
ASSIGN/V1="_PP_"
ASSIGN/V2=SYSTEMDATE( "dd'.'MM'.'yyyy' ")
ASSIGN/V3="C:\\MACHINE\\REPORTS\\PP\"
ASSIGN/V4=V3+V2+V1
PRINT/REPORT,EXEC MODE=END,$
TO_FILE=ON,AUTO=V4,AUTO OPEN=OFF,$
TO_PRINTER=OFF,COPIES=1,$
TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
TO_EXCEL=OFF,$
PREVIOUS_RUNS=DELETE_INSTANCES
END_IF/
IF/OPTION2
ASSIGN/V5="_MP_"
ASSIGN/V6=SYSTEMDATE( "dd'.'MM'.'yyyy' ")
ASSIGN/V7="C:\\MACHINE\\REPORTS\\MP\"
ASSIGN/V8=V7+V6+V5
PRINT/REPORT,EXEC MODE=END,$
TO_FILE=ON,AUTO=V8,AUTO OPEN=OFF,$
TO_PRINTER=OFF,COPIES=1,$
TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
TO_EXCEL=OFF,$
PREVIOUS_RUNS=DELETE_INSTANCES
END_IF/​
END_IF/​


Under Events, EventClick, In the VBS Mini editor. I just added the following code:
TheView.Cancel


What I did wrong or what needs to be added or changed ?



Parents
  • Can't tell on what object you put the event on.
    I created a form with 3 check boxes and 1 button.
    The button I used to close the form with the EventClick which calls "theView.Cancel" but I also did what I think you did and just used the a mouse click on the form to fire the event and close the form.

    I used the following to run the form (I'm using 2018 R1).
    I also tried 2018 R2 SP14 and that also worked for my test.

    Executing the FORM displays the form with nothing checked. I checked various buttons and then the form itself to close it.
    Each time the variables were updated to reflect which buttons were pressed.
    You can add COMMENTs to see what the values are after the form is executed.

    On another note if OPTION1 is selected, OPTION2 will not print as all the data was already output with OPTION1.

    I noticed your object names are BUTTON1, 2, 3, Did you add a button or a checkbutton? The code you placed in pcdmis will work with a checkbutton - not a regular button which has no check setting. This would explain why the value is not updated and is always 0.



    ASSIGN/OPTION1=0
                ASSIGN/OPTION2=0
                ASSIGN/OPTION3=0
    CS1        =FORM/FILENAME= C:\USERS\PUBLIC\DOCUMENTS\HEXAGON\PC-DMIS\2018 R1\TESTBUTTON.FORM
                PARAM/CHECKBUTTON1.CHECK=OPTION1
                PARAM/CHECKBUTTON2.CHECK=OPTION2
                PARAM/CHECKBUTTON3.CHECK=OPTION3
                PARAM/=
                ENDFORM/
                COMMENT/OPER,YES,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                "The value of OPTION1 = " + OPTION1
                "The value of OPTION1 = " + OPTION2
                "The value of OPTION1 = " + OPTION3
                IF/OPTION1
                  COMMENT/OPER,YES,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                  Please Edit Comment Text!
                END_IF/​
Reply
  • Can't tell on what object you put the event on.
    I created a form with 3 check boxes and 1 button.
    The button I used to close the form with the EventClick which calls "theView.Cancel" but I also did what I think you did and just used the a mouse click on the form to fire the event and close the form.

    I used the following to run the form (I'm using 2018 R1).
    I also tried 2018 R2 SP14 and that also worked for my test.

    Executing the FORM displays the form with nothing checked. I checked various buttons and then the form itself to close it.
    Each time the variables were updated to reflect which buttons were pressed.
    You can add COMMENTs to see what the values are after the form is executed.

    On another note if OPTION1 is selected, OPTION2 will not print as all the data was already output with OPTION1.

    I noticed your object names are BUTTON1, 2, 3, Did you add a button or a checkbutton? The code you placed in pcdmis will work with a checkbutton - not a regular button which has no check setting. This would explain why the value is not updated and is always 0.



    ASSIGN/OPTION1=0
                ASSIGN/OPTION2=0
                ASSIGN/OPTION3=0
    CS1        =FORM/FILENAME= C:\USERS\PUBLIC\DOCUMENTS\HEXAGON\PC-DMIS\2018 R1\TESTBUTTON.FORM
                PARAM/CHECKBUTTON1.CHECK=OPTION1
                PARAM/CHECKBUTTON2.CHECK=OPTION2
                PARAM/CHECKBUTTON3.CHECK=OPTION3
                PARAM/=
                ENDFORM/
                COMMENT/OPER,YES,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                "The value of OPTION1 = " + OPTION1
                "The value of OPTION1 = " + OPTION2
                "The value of OPTION1 = " + OPTION3
                IF/OPTION1
                  COMMENT/OPER,YES,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                  Please Edit Comment Text!
                END_IF/​
Children
No Data