Hi All,
What is the purpose of "&" in 1&
in the following procedure call?
sndPlaySound32(WhatSound, 1&)
Hi All,
What is the purpose of "&" in 1&
in the following procedure call?
sndPlaySound32(WhatSound, 1&)
It tells the compiler the second parameter is a long
and not just an int
.
This is needed for cases where the host language doesn't have an explicit knowledge of the API or the call isn't declared manually so that type-conversion can happen properly.
The full list of sigils that can be used include the following; generally @
and $
aren't used for API calls.
@
= Decimal#
= Double (8 bytes)%
= Integer (2 bytes)&
= Long (4 bytes)!
= Single (4 bytes)$
= StringThe use of such type specifiers is deprecated, but for the record these are the different variable types:
& Long
% Integer
# Double
! Single
@ Decimal
$ String