Hello Guest it is March 28, 2024, 01:08:42 PM

Author Topic: Zero X +Y button?  (Read 4424 times)

0 Members and 1 Guest are viewing this topic.

Offline budman68

*
  • *
  •  2,352 2,352
    • View Profile
Zero X +Y button?
« on: June 14, 2010, 03:30:37 PM »
Hi all,

Yes, it's another dumb simple VB question from me.

I would like a button on my screen to Zero the X + Y DRO's together with one press.

I know I can use the OEM codes 1008 (X) and 1009 (Y), but how do I make a VB script to do this?

Thank you kindly-
Dave

----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)

Offline Greolt

*
  •  956 956
    • View Profile
Re: Zero X +Y button?
« Reply #1 on: June 14, 2010, 04:37:36 PM »
Dave

You could use this code as your button script

SetOEMDRO (800,0)
SetOEMDRO (801,0)

Greg

Offline budman68

*
  • *
  •  2,352 2,352
    • View Profile
Re: Zero X +Y button?
« Reply #2 on: June 14, 2010, 04:44:32 PM »
Worked perfectly Greg, thank you very much.

Now I realized you're using the OEM codes for the DROs, but how did you know how to put the comma and add the zero's to actually zero the DRO? Is it just from fooling around with VB, or do you actually know VB scripting/code?

Again, thank you- :)
Dave
----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)

Offline Greolt

*
  •  956 956
    • View Profile
Re: Zero X +Y button?
« Reply #3 on: June 14, 2010, 04:47:19 PM »
Dave

The little I know of this stuff is just by looking at other examples and fooling around with it.  :)

Greg

Offline budman68

*
  • *
  •  2,352 2,352
    • View Profile
Re: Zero X +Y button?
« Reply #4 on: June 14, 2010, 04:48:49 PM »
Ah, I guess that's how I'll be "learning" as well, lol!

Dave
----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Zero X +Y button?
« Reply #5 on: June 15, 2010, 08:29:18 AM »
There's useful info for things like this in the WIKI including a Cypress VB manual such as it is.. There is I believe a newer version of the (Mach specific) VB reference written by (I think) HimyKabibble but I'm not sure where it is. Maybe a sticky at the top of this topic would be an idea?

Cheers

Ian