comparison doc/interpreter/basics.txi @ 8015:30629059b72d

Update the manual to reflect the changes in error output
author sh@sh-laptop
date Wed, 06 Aug 2008 22:23:54 +0200
parents 120f3135952f
children fa78cb8d8a5c
comparison
equal deleted inserted replaced
8014:44d206ae68c9 8015:30629059b72d
735 Octave will respond immediately with a message like this: 735 Octave will respond immediately with a message like this:
736 736
737 @example 737 @example
738 parse error: 738 parse error:
739 739
740 functon y = f (x) y = x^2; endfunction 740 syntax error
741 ^ 741
742 >>> functon y = f (x) y = x^2; endfunction
743 ^
742 @end example 744 @end example
743 745
744 @noindent 746 @noindent
745 For most parse errors, Octave uses a caret (@samp{^}) to mark the point 747 For most parse errors, Octave uses a caret (@samp{^}) to mark the point
746 on the line where it was unable to make sense of your input. In this 748 on the line where it was unable to make sense of your input. In this
765 767
766 @c Using 'smallexample' to make text fit on page when creating smallbook. 768 @c Using 'smallexample' to make text fit on page when creating smallbook.
767 @smallexample 769 @smallexample
768 @group 770 @group
769 error: `x' undefined near line 1 column 24 771 error: `x' undefined near line 1 column 24
770 error: evaluating expression near line 1, column 24 772 error: called from:
771 error: evaluating assignment expression near line 1, column 22 773 error: f at line 1, column 22
772 error: called from `f'
773 @end group 774 @end group
774 @end smallexample 775 @end smallexample
775 776
776 @noindent 777 @noindent
777 This error message has several parts, and gives you quite a bit of 778 This error message has several parts, and gives you quite a bit of
785 are counted from the beginning of the file containing the function 786 are counted from the beginning of the file containing the function
786 definition. For errors occurring at the top level, the line number 787 definition. For errors occurring at the top level, the line number
787 indicates the input line number, which is usually displayed in the 788 indicates the input line number, which is usually displayed in the
788 prompt string. 789 prompt string.
789 790
790 The second and third lines in the example indicate that the error 791 The second and third lines in the error message indicates that the error occurred
791 occurred within an assignment expression, and the last line of the error 792 within the function @code{f}. If the function @code{f} had been called from
792 message indicates that the error occurred within the function @code{f}. 793 another function, for example, @code{g}, the list of errors would have ended with
793 If the function @code{f} had been called from another function, for 794 one more line:
794 example, @code{g}, the list of errors would have ended with one more 795
795 line: 796 @example
796 797 error: g at line 1, column 17
797 @example
798 error: called from `g'
799 @end example 798 @end example
800 799
801 These lists of function calls usually make it fairly easy to trace the 800 These lists of function calls usually make it fairly easy to trace the
802 path your program took before the error occurred, and to correct the 801 path your program took before the error occurred, and to correct the
803 error before trying again. 802 error before trying again.