Lookup table syntax.....


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2009
    Posts
    41

    Default Lookup table syntax.....

    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

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947


    Did you find this post helpful? Yes | No

    Default

    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

  3. #3
    Join Date
    Feb 2009
    Posts
    41


    Did you find this post helpful? Yes | No

    Default

    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

  4. #4
    Join Date
    Feb 2009
    Posts
    41


    Did you find this post helpful? Yes | No

    Default

    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

  5. #5
    Join Date
    Feb 2009
    Posts
    41


    Did you find this post helpful? Yes | No

    Default

    Hmmm...

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

Similar Threads

  1. Lookup table or Math?
    By ronjodu in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 2nd May 2008, 17:55
  2. Lookup Table
    By yasser hassani in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 11th March 2008, 10:38
  3. problem with USART
    By leemin in forum Serial
    Replies: 4
    Last Post: - 11th December 2006, 17:56
  4. Need help with lookup table or direct calculation
    By nverma in forum mel PIC BASIC Pro
    Replies: 24
    Last Post: - 11th October 2006, 18:27
  5. Real Time Clock & Eeprom
    By smart_storm in forum General
    Replies: 8
    Last Post: - 17th February 2006, 19:03

Members who have read this thread : 1

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts