Top
Back: 5.2.4 else
Forward: 5.2.6 for
FastBack: 5. Functions and system variables
FastForward: 6. Tricks and pitfalls
Up: 5.2 Control structures
Top: Singular 2-0-4 Manual
Contents: Table of Contents
Index: F. Index
About: About This Document

5.2.5 export

Syntax:

export name ;
export list_of_names ;

Purpose:

converts a local variable of a procedure to a global one.

Note:

Objects defined in a ring are not automatically exported when exporting the ring (use keepring instead).

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 keepring.


Top Back: 5.2.4 else Forward: 5.2.6 for FastBack: 5. Functions and system variables FastForward: 6. Tricks and pitfalls Up: 5.2 Control structures Top: Singular 2-0-4 Manual Contents: Table of Contents Index: F. Index About: About This Document
            User manual for Singular version 2-0-4, October 2002, generated by texi2html.