Hi Filip, The problem with these kind of issues is finding the reproduction scenario. I made one and found indeed a problem which might be a compiler issue.
Attached you find a test program that I made to reproduce your issue. There are 6 test and test number 5 goes wrong (when counter is not equal to 0) and a workaroud is given in test 6 by using a temporary variable. The output of test 5 and test 6 should have been the same but it is not, see screenshot below. [cid:78423049-8124-4154-9d1d-ada2a50e63cc] I need to analyze this further to see where the compiler goes wrong. For now your problem could be fixed by using a temporary variable. Please give it a try and let me know if it solves your problem. Thanks. Kind regards, Rob ________________________________ Van: jallib@googlegroups.com <jallib@googlegroups.com> namens flyway38 <fsfon...@gmail.com> Verzonden: vrijdag 16 december 2022 22:46 Aan: jallib <jallib@googlegroups.com> Onderwerp: Re: [jallib] Re: For Loop Issue Missed this information above. n goes from 0 to something like 20, and nSmsCenterPhone is also a byte and assumes 12 in this case. On Friday, December 16, 2022 at 9:41:07 PM UTC flyway38 wrote: Hi Rob, Thanks for your support. Both vars are bytes. Cheers, FS On Friday, December 16, 2022 at 6:52:05 PM UTC rob...@hotmail.com wrote: Hi Filip, No idea. I need to see if I can reproduce this. Of what type are Index and n? What is the value of n? Thanks Kind regards, Rob ________________________________ Van: jal...@googlegroups.com <jal...@googlegroups.com> namens flyway38 <fsfo...@gmail.com> Verzonden: vrijdag 16 december 2022 19:34 Aan: jallib <jal...@googlegroups.com> Onderwerp: [jallib] Re: For Loop Issue Heres the issue in a different form: This code works: for nSmsCenterPhone+1 using Index loop SmsCenterPhone[Index]=data_eeprom(Index+n)+48 end loop SmsCenterPhone[0]=data_eeprom(n) -- Insert "+" @[0] This should work and the same, but no... it doesn't work. SmsCenterPhone[0]=data_eeprom(n) -- Insert "+" @[0] for nSmsCenterPhone using Index loop SmsCenterPhone[Index+1]=data_eeprom(Index+n+1)+48 end loop Very odd issue. Any ideas? Thank you. Cheers, FS On Friday, December 16, 2022 at 6:15:16 PM UTC flyway38 wrote: Hello all, Have found an odd issue. Maybe me not doing it right, but need to ear from you about it. Here's the code: for nSmsCenterPhone using Index loop SmsCenterPhone[Index+1]=data_eeprom(Index+n)+48 end loop Situation is; I need to start filling array SmsCenterPhone[20] starting from 2nd byte [1]. It fails and don't understand why. EEprom data is ok. Have double checked it. Have found that it works if I don't add +1 do Index to SmsCenterPhone[Index+1], but would like to understand why this is happening. Thank you very much. Kind regards, Filipe Santos -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to jallib+un...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/a5e8729b-7dc4-4f2d-904f-7950f3b3d05cn%40googlegroups.com<https://groups.google.com/d/msgid/jallib/a5e8729b-7dc4-4f2d-904f-7950f3b3d05cn%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to jallib+unsubscr...@googlegroups.com<mailto:jallib+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/adb14af6-a36e-4440-9c9d-14d69514636fn%40googlegroups.com<https://groups.google.com/d/msgid/jallib/adb14af6-a36e-4440-9c9d-14d69514636fn%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to jallib+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/GVXP195MB1637CA9F2DBE49FAB7B1C589E6E79%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM.
16f1825_index_problem.jal
Description: 16f1825_index_problem.jal