Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Simple script seems to be getting a "return" command after my subroutine but I can't see why



  • Please log in to reply
2 replies to this topic
LivingDaylight
  • Members
  • 15 posts
  • Last active: Jun 25 2015 05:52 PM
  • Joined: 18 Jul 2013

To help diagnose why this script wouldn't do what I wanted I added a MsgBox.  The MsgBox never comes up, and the script appears to end after the subroutine.  See below.

 

All it does is answer a generic question then insert your initials into the next cell, then.

;COMPLETE CORPORATE TAX PLANNING QUESTIONNAIRE
;---------------------------------------------

^+q::

SetKeyDelay 50
InputBox, Initials, Input initials!,,,200,100,,,,,
GoSub, SignCTPQ
MsgBox Script Complete!
Return

SignCTPQ:
	Send Y {Tab} %Initials% +{tab}
	Sleep 50



Exaskryz
  • Members
  • 3249 posts
  • Last active: Nov 20 2015 05:30 AM
  • Joined: 23 Aug 2012
✓  Best Answer

Is that the end of your code?

 

When the script reaches the end of the code, it treats it as an Exit command as far as I can tell.

 

So, just put a return at the end of your subroutine. This is the only way that a subroutine will tell the "main routine" to go to its next step. If you use an Exit step, the entire thread terminates.



LivingDaylight
  • Members
  • 15 posts
  • Last active: Jun 25 2015 05:52 PM
  • Joined: 18 Jul 2013

I didn't realize it worked that way.  Thank you so much!  It works!