Specifications
51
You are not forced to accept this. You can easily backspace to the beginning of the line and start your typing
there, if you like that better. You might write something like:
AnySeg Segment1 = {
Mass = 1.0;
The editor will discover that you did not like its suggested indentation, so the next line you type will begin at
the same character as Mass, and you may proceed to finish the definition of the segment by typing:
AnySeg Segment1 = {
Mass = 1.0;
Jii = {0.1,0.01,0.1};
};
Auto format
Perhaps you decide at this point that the indentation is better after all. (If you do not decide at this point,
you surely will when you have written a few hundred lines and are trying to balance your start and end
braces.) So, how can you restore the default indentation? Well, the AnyScript editor has a very nice feature
called Auto format. It allows you to block a part of the code or the entire file and indent it in one simple
step.
Try highlighting the block you have written , and press Alt-F8. You should get this result:
AnySeg Segment1 = {
Mass = 1.0;
Jii = {0.1,0.01,0.1};
};
This facility is also available in through the pull-down menu Edit->Format Indentation.
If you are ever in a situation where the model will not load and you suspect that you have forgotten a brace
somewhere, simply block the entire file and apply Auto format to it. You will usually be able to see by a few
glances where the error is located.
You can also manually control the indentation of a block of lines. A highlighted block of text can be indented
or unindented in steps of two spaces by pressing Tab or Shift-Tab.
Tree Views
The structure of an AnyScript model is hierarchical. This means that it is obvious to represent the loaded
model as a tree, and the system makes extensive use of this representation in all its different window types.
If you still have the squat model from the previous lesson open, go to the main file and load it (key F7). You
should see a tree at the left hand side of the editor window as in the figure below.










