News:

;) This forum is the property of Proton software developers

Main Menu

Hi I have a problem with a LookUp

Started by Giuseppe, Jun 08, 2024, 02:04 PM

Previous topic - Next topic

Giuseppe

Hi I have a problem with a LookUp. It gives me an error for the "_" for the end of the line.
The mcu is a 12f629
Thank you


table:

Duty = LookUp index,[0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,5,5,5,6,6,7,7,7,8,_
                  8,9,9,10,10,10,11,11,12,12,13,13,14,14,15,15,16,17,17,18,18,19,19,20,21,21,22,23,23,24,24,25,26,26,_
                     27,28,29,29,30,31,31,32,33,34,34,35,36,37,37,38,39,40,40,41,42,43,44,45,45,46,47,48,49,50,51,51,52,53,_
                     54,55,56,57,58,59,60,61,62,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,79,80,81,82,83,84,85,86,87,_
                     88,89,90,92,93,94,95,96,97,98,99,101,102,103,104,105,107,108,109,110,111,113,114,115,116,117,119,120,_
                     121,122,124,125,126,127,129,130,131,133,134,135,137,138,139,141,142,143,145,146,147,149,150,151,153,_
                     154,156,157,158,160,161,163,164,165,167,168,170,171,173,174,175,177,178,180,181,183,184,186,187,189,_
                     190,192,193,195,196,198,199,201,203,204,206,207,209,210,212,213,215,217,218,220,221,223,225,226,_
                     
228,230,231,233,234,236,236,239,241,243,244,246,248,249,251,253,255]

Return

I'll put the example below.

charliecoutas

Strange. The manual says that you can omit the underline for certain commands, LookUp being one of them but it doesn't then see the second and subsequent lines. I think this is one for Les.

Charlie

John Lawton

That is strange. I compiled the code for a 18F25K20 (Amicus board) without the line extension _ character and it appears to have correctly created the data table with all 255 bytes.

John

; USER. LOOKUP AND LOOKDOWN TABLE DATA
_lelb__1
    db 0,0,0,0
    db 0,0,0,0
    db 0,1,1,1
    db 1,1,2,2
    db 2,2,3,3
    db 3,3,4,4
    db 4,5,5,5
    db 6,6,7,7
    db 7,8,8,9
    db 9,10,10,10
    db 11,11,12,12
    db 13,13,14,14
    db 15,15,16,17
    db 17,18,18,19
    db 19,20,21,21
    db 22,23,23,24
    db 24,25,26,26
    db 27,28,29,29
    db 30,31,31,32
    db 33,34,34,35
    db 36,37,37,38
    db 39,40,40,41
    db 42,43,44,45
    db 45,46,47,48
    db 49,50,51,51
    db 52,53,54,55
    db 56,57,58,59
    db 60,61,62,62
    db 63,64,65,66
    db 67,68,69,70
    db 71,72,73,74
    db 75,76,77,79
    db 80,81,82,83
    db 84,85,86,87
    db 88,89,90,92
    db 93,94,95,96
    db 97,98,99,101
    db 102,103,104,105
    db 107,108,109,110
    db 111,113,114,115
    db 116,117,119,120
    db 121,122,124,125
    db 126,127,129,130
    db 131,133,134,135
    db 137,138,139,141
    db 142,143,145,146
    db 147,149,150,151
    db 153,154,156,157
    db 158,160,161,163
    db 164,165,167,168
    db 170,171,173,174
    db 175,177,178,180
    db 181,183,184,186
    db 187,189,190,192
    db 193,195,196,198
    db 199,201,203,204
    db 206,207,209,210
    db 212,213,215,217
    db 218,220,221,223
    db 225,226,228,230
    db 231,233,234,236
    db 236,239,241,243
    db 244,246,248,249
    db 251,253,255

top204

This is a bit of an anomaly. It should have recognised the ',_' and the ',' as the line extension. However, it appears that some are not recognising the ',_' anymore, but do recognise the ','. I'll look into it ASAP.

I am trying to get rid of the ',_' in the compiler's syntax and just make it a ',' and that is why I had it recognising both for backward compatability, but something has gone wrong somewhere in some commands.

Duty = LookUp Index,[0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,5,5,5,6,6,7,7,7,8,
                     8,9,9,10,10,10,11,11,12,12,13,13,14,14,15,15,16,17,17,18,18,19,19,20,21,21,22,23,23,24,24,25,26,26,
                     27,28,29,29,30,31,31,32,33,34,34,35,36,37,37,38,39,40,40,41,42,43,44,45,45,46,47,48,49,50,51,51,52,53,
                     54,55,56,57,58,59,60,61,62,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,79,80,81,82,83,84,85,86,87,
                     88,89,90,92,93,94,95,96,97,98,99,101,102,103,104,105,107,108,109,110,111,113,114,115,116,117,119,120,
                     121,122,124,125,126,127,129,130,131,133,134,135,137,138,139,141,142,143,145,146,147,149,150,151,153,
                     154,156,157,158,160,161,163,164,165,167,168,170,171,173,174,175,177,178,180,181,183,184,186,187,189,
                     190,192,193,195,196,198,199,201,203,204,206,207,209,210,212,213,215,217,218,220,221,223,225,226,                   
                     228,230,231,233,234,236,236,239,241,243,244,246,248,249,251,253,255]

Works fine.

Giuseppe

Thanks everyone I removed "_" and it compiles without problems

keytapper

In most of the languages the line continuation is guarantee when it's enclosed within parenthesis. But like C & Co., there's the \ symbol as line join, which is becoming less used.
The languages are evolving, spoken one too, so it's natural this changes may be breaking the backward compatibilities.
Ignorance comes with a cost