Top
Back: else
Forward: exportto
FastBack: Functions
FastForward: System variables
Up: Control structures
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

5.2.6 export

Syntax:
export name ;
export list_of_names ;
Purpose:
converts a local variable of a procedure to a global one, that is the identifier is not removed at the end of the procedure. However, the package the variable belongs to is not changed.
Note:
Objects defined in a ring are not automatically exported when exporting the ring.
Example:
 
proc p1
{
  int i,j;
  export(i);
  intmat m;
  listvar();
  export(m);
}
p1();
==> // m                    [1]  intmat 1 x 1
==> // j                    [1]  int 0
==> // i                    [0]  int 0
listvar();
==> // m                    [0]  intmat 1 x 1
==> // i                    [0]  int 0

See exportto; importfrom; keepring.


Top Back: else Forward: exportto FastBack: Functions FastForward: System variables Up: Control structures Top: Singular Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 4.3.2, 2023, generated by texi2html.