Is there such a thing? PROMPT="YES_CANCEL" and/ or ABORT_ON_NO="YES"

kbelliskbellis Global Mapper UserPosts: 518Trusted User
When there is the PROMPT="YES"  - there is the resulting text box - unwanted in this case, but at least there's a Cancel button. This begs the question: Is there such a thing? PROMPT="YES_CANCEL"

When there is the PROMPT="YES_NO_CANCEL" - answering NO gets ABORT_ON_CANCEL="YES" ignored - begging the question: Is there such a thing?  ABORT_ON_NO="YES"

And then the third derivative that might also be considered: PROMPT="YES_NO" where again the ABORT_ON_NO="YES"  might be a perfect fit.

The general scenario is something like this:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// NB - Requisite: User will need to have previously installed Phil Havey's most excellent \
ExifTool program exactly per the Installation Instructions given at:\
https://sno.phy.queensu.ca/~phil/exiftool/install.html#Windows
// NB - Requisite: User will need to have previously obtained the correct \
camera's sensor dimensions; e.g., DJI FC330, 6.4mm x 4.7mm
// NB - Requisite: User should have previously defined projection for the \
Global Mapper workspace before proceeding to run Nadir Calculator
// NB - Requisite: All values for vertical/ planar/ linear units should be \
set to the same units as in the Exif data which
// likely will be metric. After running Nadir Calculator, workspace units can then be freely changed.
//
// So let's confirm the user is prepared to run Nadir Calculator

DEFINE_VAR NAME="RUN_NADIR_CALCULATOR" PROMPT="YES_NO_CANCEL" \
PROMPT_TEXT="Are you prepared to run Nadir Calculator?'\'n\'\'nPlease review the \
following before clicking Yes\nRequisite: User will need to have previously \
installed Phil Havey's most excellent \\nExifTool program exactly per the \
Installation Instructions given at:\
\\n https://sno.phy.queensu.ca/~phil/exiftool/install.html#Windows" ABORT_ON_CANCEL="YES"










Best Answer

  • bmg_bobbmg_bob Global Mapper Programmer Posts: 1,944
    Answer ✓
    Hello,

    When you use PROMPT="YES_NO", the user's choice ("YES" or "NO") is stored as the value of the variable.  You can test the result, and quit if desired:
    IF COMPARE_STR="%RUN_NADIR_CALCULATOR%=NO"
        FORCE_EXIT 
    END_IF 
    Note that, by default, the FORCE_EXIT command will end your script and close Global Mapper.  If you don't want to close Global Mapper, use FORCE_EXIT CLOSE_APP=NO.

    Cheers,
    Bob


Answers

  • kbelliskbellis Global Mapper User Posts: 518Trusted User
    Very cool - thank you sensei Bob!
Sign In or Register to comment.