functions interpreting non-numeric strings as 0
Posted: 20 Aug 2018, 15:30
- Certain functions appear to be interpreting non-numeric strings as 0
- (I was working on some custom AHK functions in C++, and wanted to see how the built-in functions identified non-numeric strings in parameters that aren't the 1st parameter, but it appears that they don't currently do this!)
- (For some functions, interpreting a non-numeric string as 0 will give a blank string by coincidence.)
Code: Select all
q:: ;non-number interpreted as 0 (a blank string is the expected output)
MsgBox, % Round(3.5, "a") ;4
MsgBox, % InStr("tttt", "t", 0, "a") ;4
MsgBox, % StrReplace("tttt", "t", "r",, "a") ;tttt
return
- (For some functions, interpreting a non-numeric string as 0 will give a blank string by coincidence.)