From bug-octave-request at bevo dot che dot wisc dot edu Wed Nov 20 10:06:32 2002 Subject: "global" bug 2.1.39? From: "John W. Eaton" To: "Randy Gober" Cc: Date: Wed, 20 Nov 2002 10:06:07 -0600 On 20-Nov-2002, Randy Gober wrote: | If I enter at the command line: | | >>global c = 3, d, e = 5 | | I get the error==> | error: `d' undefined near line 4 column 15 | | | But I can enter: | global c = 3 | global d | global e = 5 | | With no problem. | | The same goes when I use global inside a function. Looking at the Octave | online help, "global c = 3, d, e = 5" is legal command (it is in fact an | example :-) The docs are wrong now. For compatibility with Matlab the comma is now a command separator. If you want to declare multiple global variables on one line, omit the commas. If you want your code to be Matlab compatible, don't use initializers in the global statement. Write global c d e c = 3; e = 5; instead. jwe ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------