Hi all !
I have written the below script to pick up two strings on the
particular screen that I am working on, therefore please not confused
by the strange contents in the win.sendkeys commands.
I use a vector and two variables.
v[0] and v[2] contain the two strings that are both floating points.
Both have fixed two digits after the comma.
I use forced string comparison for v[1] to either add or subtract
v[0] and v[2]. If numbers are added the result is stored in a
otherwise the subtract value is stored in b.
Then the value of a or b is displayed on the screen via clip.setpaste.
However it appears that the calculation is not performed correctly,
as I am getting an error message, when running the script.
In an earlier post in this group I saw a something like :
cmd(arg.ftos("%0.2f"))
How would I use that ?
As always thanks for any help
Cheers
Below my script :
local v[5], a, s
win.sendkeys ("{ho}{au}{ar 29}{ar 3}{co}{p5 8}{co}^c")
v[0] = trim (clip.get," ",3)
wait.for (100)
win.sendkeys ("{ho}{ad 9}{ta}{co}{p5 10}{co}^c")
v[1] = trim(clip.get," ",3)
wait.for (100)
win.sendkeys ("{ta 2}{co}{p5 16}{co}^c")
v[2] = trim(clip.get," ",3)
wait.for (100)
win.sendkeys ("{au 2}{sh}{ta}{sh}|{ta}|")
a = v[0]+v[2]
s = v[0]-v[2]
If (v[1] === "minus")do
clip.setpaste (a)
else
clip.setpaste (s)
endif
quit