Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: Greolt on December 13, 2007, 10:20:53 PM

Title: Help with a simple VB script
Post by: Greolt on December 13, 2007, 10:20:53 PM

Need some pointers from the experts with this simple VB script.

It works and does what I want it to.

However I  should be able to combine some lines into one.

Particularly the two G0 moves.  Can I put these on one line so both moves happen together?

Thanks,  Greg


Xmove = GetUserDRO(1152) 'X distance DRO
Ymove = GetUserDRO(1153) 'Y distance DRO

Code "G91"
Code "G0 X" &Xmove
Code "G0 Y" &Ymove
While IsMoving ()
Wend
Code "M9"
Code "G90"
Exit Sub
Title: Re: Help with a simple VB script
Post by: Greolt on December 13, 2007, 10:48:58 PM

Well I just tried it and it works no worries.

Should have done that before posting.  ;D

This works just as well.

Xmove = GetUserDRO(1152) 'X distance DRO
Ymove = GetUserDRO(1153) 'Y distance DRO

Code "G91 G0 X" &Xmove & "Y" &Ymove
While IsMoving ()
Wend
Code "G90 M9"
Exit Sub


Greg
Title: Re: Help with a simple VB script
Post by: Kabol on December 20, 2007, 05:02:25 PM
The biggest hording in programming is the fear to try to straightforward approve.