Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: learman on June 30, 2010, 11:23:59 AM

Title: why won't this macro work??
Post by: learman on June 30, 2010, 11:23:59 AM
Hello

Im getting a "compile error" message

If Not IsActive (input4) Then   <<< will work if i get rid of this line
Code "G1 X 0.020"
While ismoving
sleep (1000)
setDro (0,0)

any Ideas??

thanks
Josh
Title: Re: why won't this macro work??
Post by: stirling on June 30, 2010, 11:26:42 AM
you need an "end if" in there.

Ian
Title: Re: why won't this macro work??
Post by: learman on June 30, 2010, 11:29:55 AM
Yes Sir!! now it works thanks

If Not IsActive (input4) Then   
Code "G1 X 0.020"
While ismoving
sleep (1000)
setDro (0,0)
end if
Title: Re: why won't this macro work??
Post by: stirling on June 30, 2010, 11:59:05 AM
might want to stick a "wend" after your sleep too. When your input goes inactive you'll likely get a syntax error. Also stick a () on the end of your isMoving (it's a function) not a sub.

Ian
Title: Re: why won't this macro work??
Post by: learman on June 30, 2010, 12:26:46 PM
If Not IsActive (input4) Then   
Code "G1 X 0.020"
While ismoving ()
Wend
sleep (1000)
setDro (0,0)
end if

Hows this?
Title: Re: why won't this macro work??
Post by: stirling on June 30, 2010, 02:21:12 PM
well you could stick it before the sleep but after would be better  ;D