1. it looks like the sub-expression within the %%s is evaluated first. should the v2-changes doc make a mention of that? originally i wasn't sure if i needed to escape quotes or not
Code: Select all
; doesn't work when escaping quotes
MsgBox("the floor of 10.1 is %Floor(`"10.1`")%")
; works when not escaping
MsgBox("the floor of 10.1 is %Floor("10.1")%")
; works using opposite quotemark
MsgBox("the floor of 10.1 is %Floor('10.1')%")
; works here, but might be confused with auto-concat and literal %s ?
MsgBox("the floor of 10.1 is %Floor(" 10.1 ")%")
Code: Select all
var := 8
;this works
MsgBox("the floor of 10.1 is %Floor("%(var + 2.1)%")%")
;this doesnt
MsgBox("the floor of 10.1 is %Floor(%(var + 2.1)%)%")
2. is there anything to worry about with the internal string/number types when doing something like this?
Code: Select all
var := 8
MsgBox(Floor("%var + 2.1%"))
3. i want this msgbox to display "10" but i can't seem to get this to work, no matter what i try. is it possible or am i trying to nest too deep? v2-changes says: "Strings and expressions can be nested to any depth."
Code: Select all
var := 8
; variable contains invalid char
flr := "Floor(var + 2.1)"
MsgBox(%flr%)
; variable contains invalid char
flr := "Floor('%var + 2.1%')"
MsgBox(%flr%)
; runs but outputs: Floor('10.09999999999999964')
flr := "Floor(%(var + 2.1)%)"
MsgBox("%flr%")
; runs but outputs: Floor('10.09999999999999964')
flr := "Floor('%var + 2.1%')"
MsgBox("%flr%")
; variable contains invalid char
flr := "Floor('%var + 2.1%')"
MsgBox("%(%flr%)%")
![Crazy :crazy:](./images/smilies/icon_crazy.gif)