Jump to content

YACE (Yet Another Calculator Example)


Recommended Posts

I'm trying a simple calculator example, but I've got a couple questions that are throwing me for a loop..

1)  How can you display the results in base 16 (hex) with the "0x" in front.. this doesn't seem to do it:

GUICtrlSetData($Input1,  "0x" + Hex(GUICtrlRead($Input1),4  ) )

Interestingly, the retrieving data part (GUICtrlRead), where the user entered data like "0x1234" works!

2) From the Language Reference Operators page, it doesn't seem like bit operations are supported..   i.e.  not (!) , left/right shift (<</>>), xor (^)..    

     or math operations like modulus (%),  not equal (!=)

    Is this correct?

 

3)  If they're not supported, having the Windows calculator app pop open and posting messages to it seems a little hacky (assuming the user still has the .exe)..   so instead, can autoit link to a dll and call functions from it, this way it's included and hidden?    Are there other ways to accomplish this?

Thanks!

 

 

Link to post
Share on other sites

1) The concatenation operator in AutoIt is an ampersand (&), not a plus (+) sign

2) Look at the Math functions in the Help file.  Not equal in AutoIt is "<>".  I guess you missed that on the operators page in the help file. ;)

image.thumb.png.e7fd89ad18bc72482b098537447fb34f.png

 

Edited by TheXman
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...