Post Reply 
Bug? or my error?
03-13-2016, 09:39 AM
Post: #2
RE: Bug? or my error?
(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.

I think I must have something global being changed, but I cannot find it.
Code:

EXPORT Erro1(NN)
BEGIN
  LOCAL CC,II,LL;
  cc:=2;LL:={2};   //  cc  vs. CC
  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.

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; ..
Try to use only one of them.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Bug? or my error? - ttw - 03-13-2016, 04:07 AM
RE: Bug? or my error? - Thomas_Sch - 03-13-2016 09:39 AM
RE: Bug? or my error? - Didier Lachieze - 03-13-2016, 09:51 AM
RE: Bug? or my error? - ttw - 03-13-2016, 11:16 AM
RE: Bug? or my error? - Thomas_Sch - 03-13-2016, 11:45 AM
RE: Bug? or my error? - DrD - 03-13-2016, 11:56 AM
RE: Bug? or my error? - Arno K - 03-13-2016, 11:57 AM
RE: Bug? or my error? - ttw - 03-13-2016, 03:15 PM



User(s) browsing this thread: 1 Guest(s)