Hello Guest it is April 19, 2024, 11:48:26 PM

Author Topic: Help with a simple VB script  (Read 3223 times)

0 Members and 1 Guest are viewing this topic.

Offline Greolt

*
  •  956 956
    • View Profile
Help with a simple VB script
« 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

Offline Greolt

*
  •  956 956
    • View Profile
Re: Help with a simple VB script
« Reply #1 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
Re: Help with a simple VB script
« Reply #2 on: December 20, 2007, 05:02:25 PM »
The biggest hording in programming is the fear to try to straightforward approve.