PDA

View Full Version : Lookup table syntax.....



TerdRatchett
- 19th May 2009, 02:19
To make my lookup tables easy to manage I use the underscore to continue
the data in equal lengths on the next line like this:

splashscreen:
Lookup GLCD_y,[$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0 0,$00,$01,$01,_
$7F,$01,$01,$1C,$2A,$49,$49,$00,$1C,$22,$41,$41,$4 1,$00,$7F,$08,_
$08,$7F,$00,$00,$7F,$0E,$10,$7F,$00,$1C,$22,$41,$4 1,$41,$22,$1C,_
$00,$00,$3F,$40,$40,$1C,$22,$41,$41,$41,$22,$1C,$0 C,$32,$41,$41,_
$49,$6B,$3A,$00,$07,$08,$78,$08,$0F,$00,$00,$00,$1 5,$55,$55,$55,_
$55,$55,$40,$15,$55,$55,$55,$55,$55,$55,$55,$55,$5 5,$55,$55,$55,_
$55,$55,$55,$55,$55,$55,$55,$55,$55,$15,$40,$55,$5 5,$55,$55,$55,_
$15,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0 0,$00,$00,$00],GLCDData
Return

However, in places where I have character data rather than bmp graphics I would prefer to work with characters like this:

GLCDPopup:
Lookup (Popup * 21) + GLCDy,[" Verify PM Connection Verify PC Connection Sending Data to PC Transfer Complete! Clock Set! Erase EEPROM? Are You Sure? Erasing EEPROM.... EEPROM ERASED! "],GLCDascii
Return

Problem is, if I try to continue data on the next line after 21 characters (display lines are 21 characters long) so it's easy to visualize messages, I get a compiler error. The underscore does not let me take up on next line....

Is there a way to do so?

TIA,
TR

Jerson
- 19th May 2009, 03:11
You can try this

Lookup (Popup * 21) + GLCDy, _
[" Verify PM Connection " _
"Verify PC Connection " _
"Sending Data to PC " _
"Transfer Complete! " _
"Clock Set! " _
"Erase EEPROM? " _
"Are You Sure? "
"Erasing EEPROM.... " _
"EEPROM ERASED! "] , GLCDascii

TerdRatchett
- 19th May 2009, 03:26
Hi Jerson,

Thanks for always being helpful!

I tried your syntax and I get:
ERROR Line 3426: Expected ']'. (PMonitor 05-18-2009.pbp)

after:
[" Verify PM Connection " _


It doesn't mind the one after:
Lookup (Popup * 21) + GLCDy, _

TR

TerdRatchett
- 19th May 2009, 04:40
As it turns out you were close Jerson, just have to close each group with end quote then follow it with a ,_

Compiles fine, works great! Much easier to visualize and manage.....

GLCDPopup:
Lookup (Popup * 21) + GLCD_y,_
["Verify PM Connection",_
"Verify PC Connection ",_
" Sending Data to PC ",_
" Transfer Complete! ",_
" Clock Set! ",_
" Erase EEPROM? ",_
" Are You Sure? ",_
" Erasing EEPROM... ",_
" EEPROM Erased! "],GLCDascii
Return


Thanks!
TR

TerdRatchett
- 19th May 2009, 04:45
Hmmm...

The forum is truncating contiguous spaces which is not conducive to documenting actual working code :(