Shop OBEX P1 Docs P2 Docs Learn Events
DAT question — Parallax Forums

DAT question

g3cwig3cwi Posts: 262
edited 2012-07-01 13:11 in Propeller 1
I have some data that consists of 26 longs. I have started to store it in a DAT section like this:

Letter_matrix long $F14A5F00, $FD6B5500, $74631880, $00000000, $00000000, $00000000, $746B5E80, $00000000, $047F1000, $00000000

However 26 on a line will make a long line. Is there a better way?

I intend to access it by:

Var1 := Letter_matrix[0] '=A
Var_etc := Letter_matrix[1] '=B

etc.

Can I split the line somehow? I tried some ways with no luck. I have even read the manual!

Cheers

Richard

Comments

  • ratronicratronic Posts: 1,451
    edited 2012-07-01 12:44
    g3cwi you can continue the line like this -
    DAT      letter_matrix long $f14A5F00,{
                          } $FD6B5500
    
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-07-01 12:53
    You don't need to comment out the CR. Do it this way:
    Letter_matrix long $F14A5F00, $FD6B5500, $74631880, $00000000  [color=red]<- Note: no comma at end of line.[/color]
                  long $00000000, $00000000, $746B5E80, $00000000
                  long $047F1000, $00000000, $12345678, $12345678
                  ... etc. ...
    

    -Phil
  • ratronicratronic Posts: 1,451
    edited 2012-07-01 12:59
    Thanks Phil!
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-07-01 13:02
    Phil,

    Don't you need a "long" on each of those lines?

    I quess I can find out for myself by trying it.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-07-01 13:03
    Oops! My bad: yes, you do. (Corrected.)

    -Phil
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-07-01 13:05
    Yes, you do need a "long" on each line.

    So you'd want to change the code to:
    Letter_matrix long $F14A5F00, $FD6B5500, $74631880, $00000000  '<- Note: no comma at end of line.
                  long $00000000, $00000000, $746B5E80, $00000000
                  long $047F1000, $00000000, $12345678, $12345678
    

    Edit: Phil, I didn't see you correction before posting this.
  • g3cwig3cwi Posts: 262
    edited 2012-07-01 13:11
    Thanks all. Sorted now.

    Richard
Sign In or Register to comment.