[GAP Forum] Help please

Alexander Konovalov alexk at mcs.st-andrews.ac.uk
Fri Aug 2 10:43:19 BST 2013


Dear Abdulsatar,

I suggest to do the following two changes:


1) move the line 

Read("d:/runprogram/starcomp.txt");

above defining the function AutGrpOfPCG in your script


2) remove 'starcomp' from 'local ...' in AutGrpOfPCG since
it is defined elsewhere.


Hope this will help,
Alexander


On 1 Aug 2013, at 20:10, Abdulsatar Al-Juburie <a.j.t.al-juburie at newcastle.ac.uk> wrote:

> Dear All, 
> 
> 
> I am struggling with the following error:
> 
> 
> gap> B:=AutGrpOfPCG([1,2,3,4,5],[[1,2],[1,3],[2,3],[4,5],[3,4]]);
> Error, Variable: 'starcomp' must have an assigned value in
>  R1 := starcomp( V, E ); called from
> <function "AutGrpOfPCG">( <arguments> )
> called from read-eval loop at line 17 of *stdin*
> you can 'return;' after assigning a value
> 
> 
> **********
> My script is:
> *************
> 
> AutGrpOfPCG:=function(V,E)  # the main program
> 
> local R1,starcomp,St;  # Declaration list
> 
> Read("d:/runprogram/starcomp.txt"); # reading another function  (starcomp) written in a separate text file
> 
> R1:=starcomp(V,E);        # calling the starcomp function
> 
> St:=R1[1];
> return[St];
> 
> end;
> 
> 
> The input to the function is:
> 
> B:=AutGrpOfPCG([1,2,3,4,5],[[1,2],[1,3],[2,3],[4,5],[3,4]]);
> 
> 
> 
> If I remove the "starcomp" from the local declaration list, the code is working but with the following warning message:
> 
> Syntax error: warning: unbound global variable
> R1:=starcomp(V,E);        
> 
> Any idea and/or help are more than appreciated
> 
> 
> Regards,
> 
> 
> Abdulsatar
> 
> 
> 
> 
> 
> _______________________________________________
> Forum mailing list
> Forum at mail.gap-system.org
> http://mail.gap-system.org/mailman/listinfo/forum




More information about the Forum mailing list