Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Subract? Divide?
#1
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 )
Code:
Copy      Help
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 )
Code:
Copy      Help
str a b c
a="100"
b="10"
c=a/b
out c


Thanks
#2

When dealing with numbers you should use
int.

Try these:

Macro ( Macro40 )
Code:
Copy      Help
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 )
Code:
Copy      Help
int a b c
a= 100
b= 10
c= a/b
out c
Taking on Quick Macros one day at a time
#3
The division one works but the subtraction one always out's 1000000 (d) everytime! Any suggestions?
#4

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
#5
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.
#6

Try this maybe?


Macro ( Macro40 )
Code:
Copy      Help
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
#7
I think there is a problem wen converting the var to an int...any ideas?

This outputs the right number...

Macro ( Macro )
Code:
Copy      Help
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 )
Code:
Copy      Help
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 ??
#8

Give this a go:


Macro ( Macro40 )
Code:
Copy      Help
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
#9
Perfect! thank you so much lol i had a brain fart there :lol:
#10

Yep, np.
Taking on Quick Macros one day at a time


Forum Jump:


Users browsing this thread: 1 Guest(s)