Bug? or my error? - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: Bug? or my error? (/thread-5864.html) |
Bug? or my error? - ttw - 03-13-2016 04:07 AM I have been spending some time trying to get the follow program (and several similar programs) to work. They (may) work for a while then failW with the error "Error: invalid input" with the "info" button showing the lines with "nextprime" and "append" showing. Sometimes the programs work for a while. I think I must have something global being changed, but I cannot find it. EXPORT Erro1(NN) BEGIN LOCAL CC,II,LL; cc:=2;LL:={2}; FOR II FROM 2 TO NN DO CC:=nextprime(CC); LL:=append(LL,CC); END; PRINT (LL); END; I have tried changing variable names to single letter (global) or making temporaries. When I insert PRINT statements before the offending lines, these just print the number 2. RE: Bug? or my error? - Thomas_Sch - 03-13-2016 09:39 AM (03-13-2016 04:07 AM)ttw Wrote: I have been spending some time trying to get the follow program (and several similar programs) to work. They (may) work for a while then failW with the error "Error: invalid input" with the "info" button showing the lines with "nextprime" and "append" showing. Sometimes the programs work for a while. In my opinion you are using two different varalbles cc and CC. Trying to run your program in the virtual prime throws an syntac arror at Code: cc:=2; .. RE: Bug? or my error? - Didier Lachieze - 03-13-2016 09:51 AM Replacing cc by CC, I'm not able to reproduce your error message, both on my real Prime and the Android application. Note that you can replace the FOR loop by MAKELIST : Code: EXPORT Erro1(NN) RE: Bug? or my error? - ttw - 03-13-2016 11:16 AM I typed wrong. They are both the same CC. It's an intermittent error which makes it hard for me to track. As every variable (except the argument to the routine) is LOCAL and each variable is initialized each time, I'm having trouble figuring things out. I'm not impressed with the PRIME; it's fast but so far useless. (And when I tried to update through the USB, my computer got fried so I cannot trust plugging it into another computer, too expensive.) I also have trouble with other similar programs which create lists using "append" or "concat" and I get errors calling "nextprime" or "isPrime?" (I think that's the spelling.) All these error are intermittent. I may try just doing a hard reset even at the cost of having to re-type in all my programs. RE: Bug? or my error? - Thomas_Sch - 03-13-2016 11:45 AM (03-13-2016 11:16 AM)ttw Wrote: ...You could save/backup all your programs via the Connectivity Kit. RE: Bug? or my error? - DrD - 03-13-2016 11:56 AM Have you seen this thread: http://www.hpmuseum.org/forum/thread-5520.html?highlight=nextprime I presume you have the latest firmware installed, if not,that's a good place to start. There may be a problem with the nextprime command, as detailed in the reference above. Other than that, I have had a few hpprime calcs for quite awhile, and like them very much, warts and all. The product development team is very responsive, here and elsewhere, to help work out issues. USB has not been a problem in all of my work with the prime, (so far, and I use them everyday). After retiring my hp50g, (batteries removed), shortly after I bought my first prime, I haven't needed it since. (I'm just trying to help put a positive spin on your feeling of not being impressed with the prime, so far). Don't forget to make a backup from your calc, if your decide to format it. You'll be able to get all your programs back, afterwards. -Dale- RE: Bug? or my error? - Arno K - 03-13-2016 11:57 AM I have only replaced your variable names to lower case and the program works correct, that is provides a list of nn primes. Here I think the error may occur as Home thinks C to be a global variable and CC then is interpreted as C*C. Arno RE: Bug? or my error? - ttw - 03-13-2016 03:15 PM Seems like it's like the error referred to in the link give up thread. I re-wrote everything avoiding any functions (except "append" and "SUB") and so far things work. (One never knows with an intermittent error.) |