MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: RE: Re: Mathematica 3.0.1 / Win95 woes



Hi Luc,

That's a bizarre bug! 

One way to avoid these kinds of errors is to use the \[IndentingNewLine]
(the alias is esc n l esc) instead of Return. Then Mathematica will
keep track of delimiters and indent the amount appropriate for the
number of open delimiters. The option LineIndent controls the amount of
indentation.

With this method of input, you'll find out immediately that you have
left out a quote, because the subsequent lines will immediately indent
to the right when you type an open quote, and indent to the left when
you type a close quote. However, this didn't completely solve the
problem, because after I fixed up the text, the closing bracket ] of
the Module was still indented to the right too much. This at least let
me know that I shouldn't evaluate the cell, since there was something
wrong with the delimiter matching. When I deleted the closing bracket
and retyped it, the indentation of the module looked correct, and
evaluated correctly.

So, why don't you change the option LineSpacing to 3 or something and
try using \[IndentingNewLine] instead of Return.

Good luck

Carl Woll
Dept of Physics
U of Washington

On Fri, 1 May 1998, Barthelet, Luc wrote:

> My flame: under win95, Mathematica 3.0.1
> 
> The editing bug that I now find the most annoying is the confused cell
> when editing quotes.
> On large input cells that have been edited many times, when one add an
> extra string, 50% of the time the front end gets confused and mixes the
> opening and closing of strings. Getting out of that is a nightmare. I
> found that I can make it happen with just a few lines of text:
> 
> test[]:=Module[
> 		{},
> 
> 		firstString = "tete";
> 		middle= "toto";
> 			lastString ="";		
> 		];
> 
> type the module above in a new document WITHOUT the line that includes
> middle.
> Then insert the line by TYPING middle = toto"; (NOTICE THAT THE OPENING
> QUOTE IS MISSING).
> Then use the left arrow and move to the beginning of toto and add the 
> missing opening quote.
> 
> Then execute the cell.
> I get this everytime:
> 
> Syntax::"bktmcp": 
>     "Expression \"\!\(Module[\(\({}\), \(\(firstString = \"tete\"\) ; \
> \(middle = \"toto\"\) ; \(lastString = \\\" \\\";\\n\\t\\t];\)\)\)\)\"
> has no \
> closing \"\!\(\"]\"\)\".\!\(\"\"\)"
> 
> to fix this you have to delete "toto" and retype "toto". then it works.
> 
> If it were limited to the cases were I type a string in reverse order, I
> could probably just learn to get better at it. but on large input
> cells, there is no way to predict what will make it fail.
> 
> end of flame. I love mathematica anyway.
> 
> Luc, who wishes for a more professional editor in the front end,
> including coloring and formatting.
> 




  • Prev by Date: Re: How to do 3D plot of vertical planes?
  • Next by Date: a^n*b^n != (a*b)^n
  • Prev by thread: Re: Mathematica 3.0.1 / Win95 woes
  • Next by thread: A "Compile" problem