SInce Macro's have been a bit of a topic lately, I thought i would post my newest set of macro's... Love em, hate em.. i dont care.. but they are useful in a limited way...

(I cetrainly would use them in an intensive loop.. but for basic operations in responce to buttons etc. they are pretty good...)

Oh ya, the are Floating Point macro's..

They are undocumented, but then again they are very straight forward..

There is 3 types of WndTxt2Float macro's.. only 1 Float2WndTxt, and 2 of the Add/Sub/Mult/Div macros... As well the Wnd Txt macros' have some basic checking for NULL strings.... (It works well with a sub-classed edit box ( +.-.1->9, e )

I also made a "fmov" macro to work like m2m...
As well as a "float" macro to dynamically define a new float..

This example Creates -1.101/Q2 + 4.3/Q1 .. (Q's are edit windows converted to float)

 LOCAL Q1 :QWORD

LOCAL Q2 :QWORD

WndTxt2Float Edit1, Q1
WndTxt2Float Edit2, Q2
Float2WndTxt Edit3, fAdd1( fDiv1( float(-1.101), Q2 ) , fDiv2( float(4.3), Q1 ) )


To avoid a huge cluster of one time QWORD's being created with the LOCAL directive, i created 2 global QWORD data variables for the macro's use.. this is why there is a 1 or a 2 following the definitions, basically allowing you to choose which data variable you wish to have the returned value stored in.. With out this, the nesting wouldnt work as bot Q1 and Q2 would refer to the same memory location....

They arn't fancy.. but they work when you want quick and ez..

Anywho.. enjoy if you can use em..

NaN
:stupid:
Posted on 2001-07-24 00:09:55 by NaN