- Joined
- Dec 12, 2012
- Messages
- 1,007
I was looking at the new
Apparently, it is now possible to declare hex-integers not only with the
Indeed, the following test script confirms this:
It seems that this is only used for the
Since when is this a thing? Was this always possible? Why do we need this redundant syntax?
I am asking because in vJass the
common.j
file (with new Reforged natives) and noticed the following:
JASS:
constant oskeytype OSKEY_BACKSPACE = ConvertOsKeyType($08)
constant oskeytype OSKEY_TAB = ConvertOsKeyType($09)
constant oskeytype OSKEY_CLEAR = ConvertOsKeyType($0C)
// and so on
Apparently, it is now possible to declare hex-integers not only with the
0x
prefix but also with the $
sign as prefix.Indeed, the following test script confirms this:
JASS:
library MyLibrary
private keyword INITS
struct MyStruct extends array
implement INITS
endstruct
private module INITS
private static method onInit takes nothing returns nothing
local integer i = $1C
local integer j = 0x1C
call BJDebugMsg(I2S(i)) // Output: 28
call BJDebugMsg(I2S(j)) // Output: 28
endmethod
endmodule
endlibrary
It seems that this is only used for the
oskeytype
definitions and nowhere else. It is not a vJass extension but works also with the vanilla editor (vJass and Jasshelper disabled).Since when is this a thing? Was this always possible? Why do we need this redundant syntax?
I am asking because in vJass the
$
sign is used for textmacros, which makes this syntax quite problematic (for example for highlighting, as can be also seen in the code snippet above).
Last edited: