Richard Robinson on Sun, 12 Aug 2018 21:40:38 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

pari gp synatx ';' and \


Hello -

I am having trouble understanding when and when not to use ';' and '\'.  i think.  Maybe it is something else I am having troubles with.

Here is snippet of simple code that always throws syntax errors when i try to run it.

"syntax error, unexpected ')', expected $end:
...tsun+=1)) ordinal+=march;)"
with the arrow pointing to the closing ')' which should match with the opening '(' for the for loop.

No  matter what I try, adding or dropping ';' or '\' none of it seems to help.

Why does it not want a closing parentheses at this point?
============================================================
for (year=1901,2000, \
     if((ordinal%7==0),{(totsun+=1))}; \
ordinal+=january; \
if((ordinal%7==0),{(totsun+=1))}; \
}

if(leap(year),{(ordinal+=februaryl)},{(ordinal+=february)}) ; \

if(((ordinal%7)==0),{(totsun+=1)}) ;\
ordinal+=march;)
============================================================


thanks for any help,
Richard