Home Online Manual
Top
Back: example
Forward: extgcd
FastBack: Functions and system variables
FastForward: Control structures
Up: Functions
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

5.1.32 execute

Syntax:
execute ( string_expression )
Type:
none
Purpose:
executes a string containing a sequence of SINGULAR commands.
Note:
The command return cannot appear in the string.
execute should be avoided in procedures whenever possible, since it may give rise to name conflicts. Moreover, such procedures cannot be precompiled (a feature which SINGULAR will provide in the future).
Example:
 
  ring r=32003,(x,y,z),dp;
  ideal i=x+y,z3+22y;
  write(":w save_i",i);
  ring r0=0,(x,y,z),Dp;
  string s="ideal k="+read("save_i")+";";
  s;
==> ideal k=x+y,z3+22y;
  execute(s); // define the ideal k
  k;
==> k[1]=x+y
==> k[2]=z3+22y