Some obscure commands I am puzzling over...

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Some obscure commands I am puzzling over...

Post by wassup » Thu Oct 23, 2003 1:56 pm

Not really sure these commands would be of any real use in MQ, but I have not been able to figure out if they work.

/varand
/varor
/varrshift
/varlshift

I can see a use for /varlshift and /varrshift, if they work in the way I expect, but everything I have tried in testing these two commands doesn't seem togive the expected result.

Could a dev check these commands and see if they actually work? If they do could you post the format for using them?

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Thu Oct 23, 2003 7:54 pm

35 views and no one has a reply?

Anyone ever used these in a macro?

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Thu Oct 23, 2003 8:08 pm

/varand and /varor are bitwise and and or functions:

Code: Select all

sub main
/declare v0 local

/varset v0 3
/varand v0 1

/echo 3&1 is 1 -> @v0

/varset v0 1
/varor v0 2

/echo 1|2 is 3 -> @v0

/return

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Post by Plazmic » Thu Oct 23, 2003 11:50 pm

/varrshift and /varlshift are the >> and << operators (shift all bits over, basically the fastest 2^n functions)

Code: Select all

/declare test local

/varset test 8
/varrshift test 2
/echo 8>>2 is @test 

/varset test 1
/varlshift test 4
/echo 1<<4 is @test 
- Plazmic

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Fri Oct 24, 2003 12:45 am

I knew what each of them were, I just didn't know the syntax for each in MQ.

Have them all updated in the documentation now. Thanks for the examples to help me with it.