LookupL / lookup problem


Go to last post By: tumbleweed
Today 17:56
Forum: Proton Plus Compiler v3
Starter: hadv215
Views: 0
Replies: 6
+ Reply to Thread
Results 1 to 4 of 4

Thread: LookupL / lookup problem27 days old

  1. #1
    Junior Member kuhrig's Avatar
    Join Date
    Aug 2005
    Posts
    90
    Thumbs Up
    Received: 6
    Given: 0
    Total Downloaded
    3.54 GB

    0 Not allowed!

    Default LookupL / lookup problem

    Again I have problems with lookupl and lookup.
    With index = 9 it does not read the 9th, instead it read the 10th.

    compiler: 3.7.0.6
    Device = 24FJ128GA308
    index = 9
    var = lookup index, [0,1,2,3,4,5,6,7,8,9,10]
    var = 10

    index = 8,
    var = 8

    workaround is: var = lookup index,[0,1,2,3,4,5,6,7,8,9,9,10]
    same with lookupl

    somebody can confirm or explain please.

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Junior Member kuhrig's Avatar
    Join Date
    Aug 2005
    Posts
    90
    Thumbs Up
    Received: 6
    Given: 0
    Total Downloaded
    3.54 GB

    1 Not allowed!

    Default Re: LookupL / lookup problem

    Proton24 1.0.5.5


  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Fanatical Contributor Les's Avatar
    Join Date
    Feb 2002
    Posts
    3,178
    Thumbs Up
    Received: 365
    Given: 132
    Total Downloaded
    1.54 GB

    0 Not allowed!

    Default Re: LookupL / lookup problem

    I've just ran some tests and I can see no problems now with Lookup or LookupL.

    I ran this snippet to test the functionality on that device. Declares and other bits not included in the code snippet for more clarity:

    Code:
        Dim MyByte As Byte
        Dim bIndex As Byte
        
        For bIndex = 0 To 39
            MyByte = LookUpL bIndex, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,_
                                     10, 11, 12, 13, 14, 15, 16, 17, 18, 19,_
                                     20, 21, 22, 23, 24, 25, 26, 27, 28, 29,_
                                     30, 31, 32, 33, 34, 35, 36, 37, 38, 39]
            HRSOutLn "Index: ", Dec2 bIndex, " Value = ", Dec MyByte
        Next
    On the serial terminal I received:
    Code:
    Index: 00 Value = 0
    Index: 01 Value = 1
    Index: 02 Value = 2
    Index: 03 Value = 3
    Index: 04 Value = 4
    Index: 05 Value = 5
    Index: 06 Value = 6
    Index: 07 Value = 7
    Index: 08 Value = 8
    Index: 09 Value = 9
    Index: 10 Value = 10
    Index: 11 Value = 11
    Index: 12 Value = 12
    Index: 13 Value = 13
    Index: 14 Value = 14
    Index: 15 Value = 15
    Index: 16 Value = 16
    Index: 17 Value = 17
    Index: 18 Value = 18
    Index: 19 Value = 19
    Index: 20 Value = 20
    Index: 21 Value = 21
    Index: 22 Value = 22
    Index: 23 Value = 23
    Index: 24 Value = 24
    Index: 25 Value = 25
    Index: 26 Value = 26
    Index: 27 Value = 27
    Index: 28 Value = 28
    Index: 29 Value = 29
    Index: 30 Value = 30
    Index: 31 Value = 31
    Index: 32 Value = 32
    Index: 33 Value = 33
    Index: 34 Value = 34
    Index: 35 Value = 35
    Index: 36 Value = 36
    Index: 37 Value = 37
    Index: 38 Value = 38
    Index: 39 Value = 39
    For more example programs for Proton and Proton24 or updates, please visit: Proton WIKI or Proton Files

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Junior Member kuhrig's Avatar
    Join Date
    Aug 2005
    Posts
    90
    Thumbs Up
    Received: 6
    Given: 0
    Total Downloaded
    3.54 GB

    1 Not allowed!

    Default Re: LookupL / lookup problem

    Les,
    Thank you for looking into it.
    I run more tests too. Took me a while to understand. I have modified it so you can spot it. Shortend your table.
    compiler 1.0.5.6

    Code:
       clear bIndex
        repeat
            mybyte = LookUp bIndex,[63,6,91,79,102,109,125,7,127,111]
            HRSOutLn "Index: ", Dec2 bIndex, " Value = ", Dec MyByte,10
            inc bIndex
        until bIndex = 10
        hrsout 13,10
    
    
        For bIndex = 0 To 19
            MyByte = LookUpL bIndex, [10, 11, 12, 13, 14, 15, 16, 17, 18, 19,_
            20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
            HRSOutLn "Index: ", Dec2 bIndex, " Value = ", Dec MyByte,10
        Next
    On the serial terminal I received:
    Code:
    Index: 00 Value = 63
    Index: 01 Value = 6
    Index: 02 Value = 91
    Index: 03 Value = 79
    Index: 04 Value = 102
    Index: 05 Value = 109
    Index: 06 Value = 125
    Index: 07 Value = 7
    Index: 08 Value = 127
    Index: 09 Value = 9
    
    Index: 00 Value = 10
    Index: 01 Value = 11
    Index: 02 Value = 12
    Index: 03 Value = 13
    Index: 04 Value = 14
    Index: 05 Value = 15
    Index: 06 Value = 16
    Index: 07 Value = 17
    Index: 08 Value = 18
    Index: 09 Value = 19
    Index: 10 Value = 20
    Index: 11 Value = 21
    Index: 12 Value = 22
    Index: 13 Value = 23
    Index: 14 Value = 24
    Index: 15 Value = 25
    Index: 16 Value = 26
    Index: 17 Value = 27
    Index: 18 Value = 28
    Index: 19 Value = 19

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. faster LookUpL
    By buddhafragt in forum Proton Plus Compiler v3
    Replies: 7
    Last Post: 29th December 2009, 19:58
  2. Anomaly with LookUpL
    By Goesgi in forum Proton Plus Compiler v3
    Replies: 3
    Last Post: 13th March 2006, 16:21
  3. [SOLVED !] LookupL and Array
    By eyal_B in forum Proton Plus Compiler v3
    Replies: 1
    Last Post: 7th December 2005, 16:44

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