You are here: Useful Tables > Symbols in Spin

Symbols in Spin

These symbols serve one or more special purposes in Spin code. There is a separate table for Symbols in Propeller Assembly.

Spin Symbols

Symbol

Purpose

%

Binary indicator: used to indicate that a value is being expressed in binary (base-2). 

%%

Quaternary indicator: used to indicate a value is being expressed in quaternary (base-4). 

$

Hexadecimal indicator: used to indicate a value is being expressed in hexadecimal (base-16). 

"

String designator: used to begin and end a string of text characters.  Usually used in Object blocks , Data blocks or in Public/Private blocks with the STRING directive.

@

Symbol Address Indicator: used immediately before a symbol to indicate the address of that symbol is to be used, rather than the value at that symbol’s location. 

@@

Object Address Plus Symbol Indicator: used immediately before a symbol to indicate the value of that symbol should be added to the object’s base address. 

_

  1. Delimiter: used as a group delimiter in constant values (where a comma ‘,’ or period ‘.’ may normally be used as a number group delimiter). 
  2. Underscore: used as part of a symbol. 

#

  1. Object-Constant reference:  used to reference a sub-object’s constants. 
  2. Enumeration Set:  used in a CON block to set the start of an enumerated set of symbols. 

.

  1. Object-Method reference:  used to reference a sub-object’s methods. 
  2. Decimal point:  used in floating-point constant expressions. 

..

Range indicator: indicates a range from one expression to another for CASE statements or an I/O register index.

:

  1. Return value separator:  appears immediately before a symbolic return value on a PUB or PRI declaration.
  2. Object assignment:  appears in an object reference declaration in an OBJ block.
  3. Case statement separator:  appears immediately after the match expressions in a CASE structure.

|

  1. Local variable separator:  appears immediately before a list of local variables on a PUB or PRI declaration.
  2. Bitwise OR:  used in expressions. 

\

Abort trap:  appears immediately before a method call that could potentially abort. 

,

List delimiter:  used to separate items in lists.

( )

Parameter list designators:  used to surround method parameters.

[ ]

Array index designators:  used to surround indexes on variable arrays or main memory references.

'

Code comment designator:  used to enter single-line code comments (non-compiled text) for code viewing purposes.

''

Document comment designator:  used to enter single-line document comments (non-compiled text) for documentation viewing purposes.

{ }

In-line/multi-line code comment designators:  used to enter multi-line code comments (non-compiled text) for code viewing purposes. 

{{ }}

In-line/multi-line document comment designators:  used to enter multi-line document comments (non-compiled text) for documentation viewing purposes.

 

Propeller Help Version 1.1

Copyright © Parallax Inc.

5/13/2009