help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Xoctave console trying to parse input() function prompt script in additi


From: Jeff Schuss
Subject: Xoctave console trying to parse input() function prompt script in addition to actual user input
Date: Mon, 23 May 2011 11:01:31 -0700

I'm currently using Octave in Windows through Xoctave and I'm having the following problem.

I attempted to run a script that starts with

activity = input("What would you like to do? ");

When I called this script in the console, it prints out

What would you like to do?

When I key in a number and press enter, it returns:

What would you like to do? 1

error: `What' undefined near line 4 column 1

>> 

It seems as if the console is trying to parse the output of the previous command (i.e., trying to parse the whole line, including the prompt text).

To get a clearer picture of what I'm trying to say, just save a script with only the line:

m = input('Enter m: ');

then try to run that script in Xoctave. I believe you'll get the same error too.

I believe this has to do with changing the default parsing behavior, but I'm not sure how.


To clarify the issue, it creates a similar, yet significantly more frustrating problem using the menu function. if i do this:

number=menu("What's your favorite number?",1,2,3,4,5); 

it prompts:

[ 1] 1
[ 2] 2
[ 3] 3
[ 4] 4
[ 5] 5

pick a number, any number:  

I key in 3 and press enter and it returns: "error: input invalid or out of range" because it is trying to parse the entire line, including the prompt! =[ help!

Also, I'm using Xoctave to interface with the Octave command line in Windows. Not sure if this helps.

Thanks!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]