Code: Select all
MsgBox("Forward: " (str := "💩emoji"))
DllCall("msvcrt\_wcsrev", "str", str, "CDecl str")
MsgBox("Reversed: " str)
The script is saved in UTF-8-BOM
Code: Select all
MsgBox("Forward: " (str := "💩emoji"))
DllCall("msvcrt\_wcsrev", "str", str, "CDecl str")
MsgBox("Reversed: " str)
I meant splitting by chars like:
Code: Select all
arr := StrSplit("💩")
MsgBox(arr[1] "`n" arr[2])
This is correct.
It is not necessary to specify str for the return value, [edit: see lexikos' correction below] in fact it is a bit wasteful since it will yield a copy of the string and then immediately discard it.DllCall("msvcrt\_wcsrev", "str", str, "CDecl str")
DllCall doesn't copy the string or allocate any memory; it just returns the pointer. Because the call is the last operation of an expression statement (i.e. the value isn't going to be used), no memory is allocated and the string isn't copied.
Users browsing this forum: kunkel321, shipaddicted, Spikea and 65 guests