geossl
geossl

Reputation:

& in procedure parameter - Purpose of "&"?

What is the purpose of "&" in 1& in the following procedure call?

   sndPlaySound32(WhatSound, 1&)

Upvotes: 3

Views: 155

Answers (2)

lavinio
lavinio

Reputation: 24299

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)
  • $ = String

Upvotes: 8

Lunatik
Lunatik

Reputation: 3948

The use of such type specifiers is deprecated, but for the record these are the different variable types:

& Long
% Integer
# Double
! Single
@ Decimal
$ String

Upvotes: 1

Related Questions