Posts: 576
Threads: 97
Joined: Aug 2007
Hey im killing myself tryin to figure this out lol i know i know how to do it just cant remember maybe have to use from but cant get it to work but what i want to do is below....
Macro ( Macro )
str a b c
int d
0 WV "Finance"
a.getwintext(id(1918 "Finance"))
a.replacerx(",")
out a
d="1000000"
c=(d-a)
out c
Something like that but i know i dont use c=(d-a) please help lol only part i have problem with is the part to subtract a from int d maybe d must be a var. please help lol thanks!
Also same thing with this? Division? how would i do some kind of division...example...
Macro ( Macro2 )
str a b c
a="100"
b="10"
c=a/b
out c
Thanks
Posts: 473
Threads: 33
Joined: Aug 2007
When dealing with numbers you should use int.
Try these:
Macro ( Macro40 )
str a c
int d b
0 WV "Finance"
a.getwintext(id(1918 "Finance"))
a.replacerx(",")
a=b
out b
d=1000000
c= d-b
out c
Macro ( Macro43 )
int a b c
a= 100
b= 10
c= a/b
out c
Taking on Quick Macros one day at a time
Posts: 576
Threads: 97
Joined: Aug 2007
The division one works but the subtraction one always out's 1000000 (d) everytime! Any suggestions?
Posts: 473
Threads: 33
Joined: Aug 2007
If I knew where the information was being grabbed from I could be of more assistance.
Taking on Quick Macros one day at a time
Posts: 576
Threads: 97
Joined: Aug 2007
All it does it take a number from a Finance Assistant i have its just a random number could be anywhere between... $5,000,000 and $500,000.
Posts: 473
Threads: 33
Joined: Aug 2007
Try this maybe?
Macro ( Macro40 )
str a c
int d b
0 WV "Finance"
a.getwintext(id(1918 "Finance"))
a.replacerx(",")
b=a
out b
d=1000000
c= d-b
out c
It's kind of hard not being able to test if i'm right or not so no garauntees.
Taking on Quick Macros one day at a time
Posts: 576
Threads: 97
Joined: Aug 2007
I think there is a problem wen converting the var to an int...any ideas?
This outputs the right number...
Macro ( Macro )
str a c
int d b
0 WV "Finance"
a.getwintext(id(1918 "Finance"))
a.replacerx(",")
;b=a
out a
;d=1000000
;c= d-b
;out c
But this doesnt...
Macro ( Macro )
str a c
int d b
0 WV "Finance"
a.getwintext(id(1918 "Finance"))
a.replacerx(",")
b=a
out b
;d=1000000
;c= d-b
;out c
Seems to be code changes after saying var=int ??
Posts: 473
Threads: 33
Joined: Aug 2007
Give this a go:
Macro ( Macro40 )
str a c
int d b e
0 WV "Finance"
a.getwintext(id(1918 "Finance"))
a.replacerx(","); e=val(a)
out e
d=1000000
c= d-e
out c
Taking on Quick Macros one day at a time
Posts: 576
Threads: 97
Joined: Aug 2007
Perfect! thank you so much lol i had a brain fart there :lol:
Posts: 473
Threads: 33
Joined: Aug 2007
Yep, np.
Taking on Quick Macros one day at a time