Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using getsel
#1
I am working with a program that I is tabled out but it isn't like excel where cells can be indetified as column/row (ie. "A1, A2..").

I am trying to right a macro to take the cell that I am currently in, copy the contents to a variable and then evaluate the variable, use left arrow to move over a cell and then paste out the resulting contents from the evaluation. See my code below and please help me.

Thank you,

#region Recorded 9/14/2017 4:33:53 PM
int w1=act(win("Costing Template Editor - Jones machining template(metric) TYLER.sldctm" "#32770"))
double i = 1
double A =1
double B =76.2
rep (1)
str s.getsel
if x>=0 and x<=3.175
A = 0.0127
else if x>=3.175 and x<=6.35
A = 0.0254
else if x>=6.35 and x<=12.7
A = 0.0508
else if x>=12.7 and x<=19.05
A = 0.0889
else if x>=19.05 and x<=25.4
A = 0.1397
else
A = 0.1905
'R
'F"{A}"
'R
'F"{B}"
'R
'D
'L
'L
'L
#endregion
#2
double x = val(s 2)
#3
#region Recorded 9/14/2017 4:33:53 PM
int w1=act(win("Costing Template Editor - Jones machining template(metric) TYLER.sldctm" "#32770"))
double i = 1
double A =1
double B =76.2
rep (1)
str s.getsel
double x=val(s 2)
if x>=0 and x<=3.175
A = 0.0127
else if x>=3.175 and x<=6.35
A = 0.0254
else if x>=6.35 and x<=12.7
A = 0.0508
else if x>=12.7 and x<=19.05
A = 0.0889
else if x>=19.05 and x<=25.4
A = 0.1397
else
A = 0.1905
'R
'F"{A}"
'R
'F"{B}"
'R
'D
'L
'L
'L
out x
#endregion

When I run this is states my x =0
#4
If s is like "0,5", replace "," with ".".

out s
s.findreplace("," ".")
out s


Forum Jump:


Users browsing this thread: 2 Guest(s)