close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 20 years ago

Closed 20 years ago

#214 closed enhancement (fixed)

MakeGlobal could improve its behavior

Reported by: danirus Owned by: danirus
Priority: lowest Milestone:
Component: Kernel Version: head
Severity: minor Keywords:
Cc:

Description

If we want to use MakeGlobal to export more than one local variable we must use
a little trick not enough elegant but usefull (See message from Iván in the list
accesible in the given URL). Would be better if we could export more than one
variable, and in every place of the local scope. We can also improve the
function english description.

Get more information (reading the spanish discussion related with this
enhancement) through the given URL.

Change History (2)

comment:1 Changed 20 years ago by danirus

Status: newassigned

comment:2 Changed 20 years ago by danirus

Resolution: fixed
Status: assignedclosed

This enhancement has been done.
You can export (or promote to global scope) any local variable:

_
Real f(Real param) {

Real locA = 10; locB = 20;
MakeGlobal(locA);
MakeGlobal(locB);
param * param

};

Real a = f(2);
Real x = locA;
Real y = locB;

That code created "a", "x", and "y" and export "locA" and "locB".

Note: See TracTickets for help on using tickets.