Gosub With Variables

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
sailor dude
Pro Scripter
Posts: 50
Joined: Fri Jan 20, 2006 10:43 pm

Gosub With Variables

Post by sailor dude » Fri Feb 03, 2006 4:21 pm

I created the following subroutine using 7.4.009. I see an error message Subroutine TAB not found. What is the correct syntax when using subroutines with variables?

Gosub>TAB,6,0,0.5

// This subroutine presses tab a number of times with a specified delay between tabs and waits an additional delay after the last tab
// For example Gosub>TAB,3,0,1 presses tab 3 times with 0 sec between tabs and 1 sec wait at the end

SRT>TAB
Let>k=0
Repeat>k
Let>k=k+1
Wait>TAB_Var_2
PRESS TAB

IF>TAB_Var_30
Wait>TAB_Var_3
ELSE

ENDIF

Until>k=TAB_Var_1

End>TAB

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Feb 03, 2006 4:34 pm

TAB is a system variable. So it's trying to go to a subroutine called the value of TAB. TAB is assigned the ascii value of the tab character. Change your subroutine name to something else ... like Press_TAB and it will work.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts