Jump to content
Macro Express Forums

Error Handling


Recommended Posts

Hello,

 

i have threePrompts to enter different names. If the user presses cancel i can handle this error - do i have to put the errorhandlingaround each of the Input lines or is there a better solution -

 

Thank you very much!

 

Martin

 

<VARIABLE SET STRING Option="\x01" Destination="%BFG%" Prompt="Bitte BFG eingeben - Mehrere bitte getrennt mit ; zB.\r\nMartin Krug; Max Muster" Mask="FALSE" OnTop="FALSE" Left="Center" Top="Center" Monitor="0"/>
<ON ERROR/>
<CATCH ERROR Code="2"/>
<MACRO RUN Use_ID="FALSE" Name="Hauptfunktion" ID="-1" Wait="TRUE"/>
<END CATCH ERROR/>
<END ERROR/>
<VARIABLE SET STRING Option="\x01" Destination="%EDVB%" Prompt="Bitte EDVB eingeben - Mehrere bitte getrennt mit ; zB.\r\nMartin Krug; Max Muster" Mask="FALSE" OnTop="FALSE" Left="Center" Top="Center" Monitor="0"/>

<ON ERROR/>
<CATCH ERROR Code="2"/>
<MACRO RUN Use_ID="FALSE" Name="Hauptfunktion" ID="-1" Wait="TRUE"/>
<END CATCH ERROR/>
<END ERROR/>
<VARIABLE SET STRING Option="\x01" Destination="%KME%" Prompt="Bitte EDVB eingeben - Mehrere bitte getrennt mit ; zB.\r\nMartin Krug; Max Muster" Mask="FALSE" OnTop="FALSE" Left="Center" Top="Center" Monitor="0"/>

<ON ERROR/>
<CATCH ERROR Code="2"/>
<MACRO RUN Use_ID="FALSE" Name="Hauptfunktion" ID="-1" Wait="TRUE"/>
<END CATCH ERROR/>
<END ERROR/>

Link to comment
Share on other sites

I don't understand why you are using error handling. Error handling is for system errors, not human. EG a file can't be read. Although for detecting "cancel" it's useful. Besides that validating user input should just be done programmatically. What I do is create a loop. The only way out of the loop is to pass a test. If they pas the test I exit the loop. If it doesn't pass the test it pops up an error message and the loop recycles. Then I usually use the cancel button to abort the macro.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...