I have this code which works fine in a loop with a hotkey.
But Now I want to make it all as a function to easily refer to this among several other functions one after one.
How to make the below to work?
Code: Select all
Fucntion_Test()
{
Clipboard := ""
;Click, Click ect
Sleep, 500
Send, {Ctrl Down}c{Ctrl Up}
ClipWait, 3
if ErrorLevel
{
MsgBox, Error
}
cell(str, oneCellRange, digits := 0) {
col := Asc(Format("{:U}", RegExReplace(oneCellRange, "\d+"))) - 64
row := RegExReplace(oneCellRange, "\D+")
line := StrSplit(str, "`n")
cellVal := StrReplace(StrReplace(StrSplit(line[row], "`t")[col], " "), ",", ".")
If cellVal is number
Return Round(cellVal, digits)
Else Return cellVal
}
MyVar := cell(Clipboard, "D1", 1)
if (MyVar >= 10000)
{
MsgBox, % MyVar
}
else Continue
}