Shop OBEX P1 Docs P2 Docs Learn Events
SPIN code Syntax Symbols repeated ie. [][] and %% ? — Parallax Forums

SPIN code Syntax Symbols repeated ie. [][] and %% ?

Phillip Y.Phillip Y. Posts: 62
edited 2006-06-09 06:38 in Propeller 1
 Rotary Encoder v1.0

PUB ReadDelta(EncID): DeltaPos
''Read delta position (relative position value since last time read) of EncID.
  DeltaPos := 0 + -(EncID < TotDelta) * -long[noparse][[/noparse]Pos][noparse][[/noparse]TotEnc+EncID] + (long[noparse][[/noparse]Pos][noparse][[/noparse]TotEnc+EncID] := long[noparse][[/noparse]Pos][noparse][[/noparse]EncID])


I dont understand the use of ·" [noparse][[/noparse] ] [noparse][[/noparse] ] " what is this a 2D array ?

I have also seen···%%0123 where each digit is 2 bits compared to %01 binary,· {VGA TEXT, palette·byte·%%333,%%001·'white / dark blue }
and·I supose that %%%01234567 woud be "octal"
and·I supose that·%%%%···········would be "hexadecimal", just like $ is.

What is the english word for the 2bit digit system ?

How many other things can be repeated like this and give unanticipated functionality ?

Phillip Y.

Comments

  • cgraceycgracey Posts: 14,206
    edited 2006-06-09 06:09
    [noparse]/noparse[noparse]/noparse can only be used·in BYTE[noparse][[/noparse]base][noparse][[/noparse]index], WORD[noparse][[/noparse]base][noparse][[/noparse]index], or LONG[noparse][[/noparse]base][noparse][[/noparse]index]. Base is the base address while index is the offset. Index is scaled x1 for BYTE, x2 for WORD, or x4 for LONG.
    %1010101 is binary.
    %%0123 is double-binary.
    $FFFF is hex.
    There are no other uses of % or $.
    Phillip Y. said...
     Rotary Encoder v1.0
    

    PUB ReadDelta(EncID): DeltaPos
    ''Read delta position (relative position value since last time read) of EncID.
      DeltaPos := 0 + -(EncID < TotDelta) * -long[noparse][[/noparse]Pos][noparse][[/noparse]TotEnc+EncID] + (long[noparse][[/noparse]Pos][noparse][[/noparse]TotEnc+EncID] := long[noparse][[/noparse]Pos][noparse][[/noparse]EncID])
    


    I dont understand the use of ·" [noparse][[/noparse] ] [noparse][[/noparse] ] " what is this a 2D array ?

    I have also seen···%%0123 where each digit is 2 bits compared to %01 binary,· {VGA TEXT, palette·byte·%%333,%%001·'white / dark blue }
    and·I supose that %%%01234567 woud be "octal"
    and·I supose that·%%%%···········would be "hexadecimal", just like $ is.

    What is the english word for the 2bit digit system ?

    How many other things can be repeated like this and give unanticipated functionality ?

    Phillip Y.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
  • Phillip Y.Phillip Y. Posts: 62
    edited 2006-06-09 06:38
    Thank you·Chip.

    I searched for ][noparse][[/noparse] and found 17 in chapter 4: Spin Language Reference, 0 for %% .

    Phillip Y.
Sign In or Register to comment.