|
| From: | anonymous |
| Subject: | [Octave-bug-tracker] [bug #38595] Global variables in function |
| Date: | Tue, 26 Mar 2013 10:01:02 +0000 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22 |
URL:
<http://savannah.gnu.org/bugs/?38595>
Summary: Global variables in function
Project: GNU Octave
Submitted by: None
Submitted on: Втр 26 Мар 2013 10:01:00
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: None
Status: None
Assigned to: None
Originator Name: Konstantin
Originator Email: address@hidden
Open/Closed: Open
Discussion Lock: Any
Release: 3.6.4
Operating System: GNU/Linux
_______________________________________________________
Details:
I explain my problem in examples:
If I define m variable once
m=2;
m
function y=f(Pi)
global m;
m
m=m+Pi;
y=m;
end
y=f(5)
m
I get an answer:
source ("test4.m")
>>>m = 2
m = 2
y = 7
m = 7
If I define the variable m twice or more:
m=2;
m=3;
m
function y=f(Pi)
global m;
m
m=m+Pi;
y=m;
end
y=f(5)
m
I get bug:
>>>m = 3
m = [](0x0)
y = [](0x0)
m = 3
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?38595>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
| [Prev in Thread] | Current Thread | [Next in Thread] |