i thought about it. Oops . i thinks it possible.
with RegExMatch(x,"\d") i proof the parameter type. if its string or a number.
i have forget that if is all only untyped parameters, its not compareable to this style: https://en.wikipedia.org/wiki/Function_overloading#Rules_in_function_overloading
Code: Select all
toolTipGui(text, x := 1, y := 1, crosshair := "", hiddenTitle := "", bgColor := "", fontSize := 0, MonitorNr :=0){
; also possible usage:
; toolTipGui(text, crosshair := "", hiddenTitle := "", bgColor := "", fontSize := 0, MonitorNr :=0)
; example: toolTipGui("hi world ", crosshair := "|-")
isXcrosshair := (x && !RegExMatch(x,"\d"))
if(isXcrosshair) ; Determines if x is not a number whether a string contains a pattern (regular expression).
{
crosshair := x
x := 1
if(y)
hiddenTitle := y
if(bgColor)
MonitorNr := bgColor
if(crosshair)
bgColor := crosshair
if(hiddenTitle)
fontSize := hiddenTitle
if(crosshair)
bgColor := crosshair
y := 1
}
else
if(y && !RegExMatch(y,"\d")) ; Determines if x is not a number whether a string contains a pattern (regular expression).
{
if(fontSize)
MonitorNr := fontSize
if(bgColor)
fontSize := bgColor
if(hiddenTitle)
bgColor := hiddenTitle
if(crosshair)
hiddenTitle := crosshair
crosshair := y
; hiddenTitle := y
y := (x) ? x : 1
x := 1
; pause
}
if(!y)
y := 1
....