The first image above is that of Statistics101 in its normal or "editing" mode. The second image above is that of Statistics101 in its "debug" mode with its Edit tab window showing. The primary features of the Statistics101 main window are, from top to bottom: the menu bar, the tool bar, the help bar, and two panels separated by a dividing bar. The upper panel is for editing and debugging Resampling Stats programs, called the Programming Panel, and the lower one one, called the output panel or Output Window, for displaying output text and graphs. Finally, at the very bottom of the frame is the progress indicator, which only appears when a user program is running.
The menu bar contains the usual File and Edit commands as well as commands to run, abort, and debug a program, indent the program text, and clear the Output Window, among others. The individual menu selections are detailed later.
The tool bar allows quick access to the most-used functions. Most of the tool bar buttons duplicate actions that are also accessible via the menus. The tool bar is detachable from the window by clicking on its "handle" and dragging it out of the window. You can also dock it on the right or left side, or on the bottom, of the main window. Notice that some toolbar buttons are enabled or disabled depending on the mode and that some button icons change depending on the mode. From left to right, the buttons on the tool bar are:
Button |
Name |
Explanation |
---|---|---|
New |
Causes the Edit Window to be cleared and ready for you to type in a new program. If the current program in the Edit Window has not been saved, you will be asked either to save it or discard it before the window is cleared. |
|
Save/Save As |
Saves the contents of the Edit Window into the file in which it was last saved. If the Edit Window contents were manually entered following a "New" menu selection, then you will be requested to specify a file name. If you hold down the shift key while clicking this button it will bring up a "Save As..." dialog. |
|
Check program syntax |
Scans the program in the Edit Window to verify that its syntax is correct. Any INCLUDE commands are expanded and their syntax is also checked. Whatever the result, a message to that effect will be displayed in the Output Window. |
|
Indent program |
This and the next two buttons are useful to format your Resampling Stats code in the Edit window. This button formats the contents of the Edit Window by indenting all commands that are nested in IF, REPEAT, and WHILE commands. This makes the program easier to read. Does not change the case of any commands. Normally, this button will indent command lines but will not indent comment lines (that is, lines that begin with an apostrophe). If you hold down the Shift key while clicking on this button, it will indent both command lines and comment lines. |
|
Indent program, upper case |
This has the same effect as the previous button except that it also forces all the commands to display in upper case. Normally, this button will indent command lines but will not indent comment lines (that is, lines that begin with an apostrophe). If you hold down the Shift key while clicking on this button, it will indent both command lines and comment lines. |
|
Indent program, lower case |
This has the same effect as the previous button except that it forces all the commands to display in lower case. Normally, this button will indent command lines but will not indent comment lines (that is, lines that begin with an apostrophe). If you hold down the Shift key while clicking on this button, it will indent both command lines and comment lines. |
|
Mark selection as comment |
This and the next two buttons are useful to edit multi-line comments in your program. This one adds the comment marker (') to the beginning of any lines that are selected in the Edit Window. If you hold the Shift key down while clicking this button, any comment mark in the first column of each line in the selection is removed. You can type in a multi-line comment without worrying about marking each line as you type, then when you are done, you can select your comment and use this button to mark all its lines at once. You can also use this feature to comment-out sections of your code during testing. You can also use this to remove comment marks prior to shifting the comment lines left or right (using the next button on the toolbar) or prior to wrapping the lines (using the Wrap button, two buttons over). After those changes you can use this button to replace the comment marks. This works only in the Edit Window, not the Debug Window. |
|
Move selected lines right or left by one space |
Moves selected lines one space to the right each time it is clicked. If you hold the Shift key down while clicking this button, it will move the selected lines one space to the left unless there are no leading spaces to remove. This works only in the Edit Window, not the Debug Window. If you also hold down the Alt key, any leading comment marks (') will be removed, the selection will then be shifted right or left depending on the state of the Shift key, then the comment marks will be reinserted at the beginning of each line of the selection. This is an easy way to shift comment paragraphs. |
|
Wrap selected lines into one paragraph. |
Combines all selected lines into one paragraph and wraps the lines:
Any sequence of blanks will be reduced to a single blank. You can use this to adjust comment lines that are too long or too short. This should only be performed on text that is intended to be comments. It should not be used on your program code, because the result won't be readable by you or by Statistics101. This works only in the Edit Window, not the Debug Window. |
|
Clear Output Window |
If there is no selection in the Output Window, clicking this button will display a dialog asking whether you really want to clear the Output Window. If you answer yes, the window will be cleared. If you answer no, the window will remain unchanged. If you Shift-click this button (i.e., hold down the Shift key and click on the button), the Output Window will be cleared without requesting your permission. If there is a selection, only the selection will be deleted. There is no confirmation dialog for deleting a selection. |
|
Run program |
Runs the program displayed in the Edit Window. |
|
Continue program |
This button is only enabled when a running program has paused because of the PAUSE command. Clicking this button allows the program to continue from where it had paused. |
|
Abort program |
This button is only enabled when a program is running. Clicking this button will display a dialog asking whether you really want to abort the program. If you say yes, the program will quit. If you say no, the program will continue running. |
|
Enter Debug step mode |
Clicking this button will start the program into debug mode. Statistics101 will scan your program for syntax errors. If no errors, the program will be started in "step mode". This means that you can step through your program's commands one at a time and observe how your program variables change. If syntax errors were found, the program will be aborted and the first error will be reported for you to correct. NOTE: this and the next two buttons (Continue and Pause) share the same position in the toolbar. Only one is showing at a time depending on what mode the debugger is running in. |
|
Continue program full speed from current step in debug mode |
Clicking this button while in debug step mode will cause your Resampling Stats program to continue executing from the current command at full speed. The program will run until it finishes, of encounters a DEBUG command. The DEBUG command will cause the program to pause and go into single step mode. |
|
Pause program in debug mode |
If your Resampling Stats program is running in "continue" mode (see previous table row), clicking this button will cause the program to stop where it is and enter single step mode. |
|
Single step |
When this button is enabled, clicking it will step through your program one command at a time. Be aware that each operator and each function in a LET command takes one program "step". Therefore, if your program is stopped on a line containing the LET command, it may take several "single steps" to complete the entire LET command. |
Below the tool bar is a "help" bar that indicates the line number and the character position number that the editor's cursor is on. It also displays the syntax of the command that is on the cursor's line. If you double-click the help bar while it's displaying a command, a new window will appear with detailed description and examples of that command. If you double-click it when no command is showing, a new window with an index to the commands will appear.
Below the syntax help bar is a bar that contains a one-sentence description of the command that the editor's cursor is on. If you double-click the description bar while it's displaying a command's description, a new window will appear with detailed description and examples of that command. If you double-click it when no command is showing, a new window with an index to the commands will appear.
Next is the Program Panel, which contains two sub-windows, each accessed via a tab. The first sub window, labeled with the Edit tab, is an editing window where you enter and/or change the Resampling Stats program. You can enter a Resampling Stats program by hand in the Edit window, or use the File>Open menu to open an existing program. You can also find and load example programs from the Help>Example Programs menu item. Note that when Statistics101 is in debug mode, editing your program is disabled. The second sub-window , labeled with the Debug tab, is strictly for viewing and debugging a program. Its background is a light gray instead of white. This is to make it easier to know at a glance which window is showing. No editing is possible in the Debug Window. Even though you cannot edit, you can still select and copy text from either tab window and paste it into another program using the keyboard shortcuts. In the Debug tab window you can set one or more breakpoints by double-clicking a program line. A breakpoint is a point in your program at which you want to enter debug mode so that you can begin viewing and/or changing program variables and single stepping. When a breakpoint is set on a line that line will be highlighted with a light blue color. Learn more about debugging in the appendix, Using the Debugger.
The lower window, called the Output Panel, is
where program output and error messages and graphical output are
displayed. If there is graphical output then each graph has its own
labeled tab and the text output panel will have a tab labeled
"Output". If there are no graphs displayed, then the text
output panel will not have a tab. Normally, the text in the Output
tab of the Output Panel is read-only, but you can copy from it by
selecting some text using the mouse, or all the text using Ctrl-A or
the right-mouse popup menu "Select All". Then you can copy
the selected text to the clipboard using the keyboard shortcut
Ctrl-C or the right-mouse popup menu "Copy", and paste the
text into any other program.
If you
double-click an error message in the Output Panel, the view of your
program in the Program Panel will jump to the offending line, which
will be highlighted in red.
You can change relative sizes of the two panels by dragging the horizontal bar that divides the two. You can hide or show the lower panel by using the Window>Show Output Panel menu item or press F6.
If you hover the pointer over a button or other GUI feature, a toolTip will appear giving a brief description of its function.
If you right-click (Control-click on the Macintosh) in either window, you will get a context-sensitive menu allowing you to select various actions.
There is a progress indicator at the bottom of the main window. It is only visible during program execution. It moves from left to right as a REPEAT loop progresses, its proportion of the whole indicating the fraction of the loop's iterations that have completed. If there are multiple non-nested REPEAT loops, there will be multiple passes across the indicator. For a WHILE loop, the total number of iterations can't be forecast, therefore the progress indicator shows a shuttle moving in a back and forth motion to indicate that it is processing. If there are no REPEAT or WHILE loops, the progress indicator will not show movement. The cursor will, however, display as an hourglass to indicate that processing is ongoing. Of course, if there are no REPEAT or WHILE loops, the program will probably complete quickly.
There are many ways to obtain help on any command. These are:
If a command is showing in the help bar, then double-clicking on the help bar will bring up a window with the command description.
If a subroutine's name is showing in the help bar, then double-clicking on the help bar will bring up a window displaying the file containing the subroutine's definition.
If the help bar is blank, double-clicking on it will bring up a window with a hyperlinked index to all the commands.
If the Edit Window's cursor is on a line containing a command for which you want help, then right-clicking (Macintosh: Ctrl-clicking) in the Edit Window and selecting "Help at Cursor" will bring up a window with the command's description.
If the command for which you want help is not already in the Edit Window, or you just want to quickly see a list of possible commands, right-click in the Edit Window to bring up the popup (see below), then move the cursor over the "Command (By Name)". That will show you a list of the commands. If you select one of the command items, a window with the description of that command will appear. The same popup menu includes a list of subroutines and a categorized list of commands and subroutines. If you select a subroutine name, then the Subroutine Browser window will appear with that subroutine highlighted.
You can get a searchable list of commands and subroutines by selecting the Help>Command/Subroutine Index menu item or pressing the F3 function key. Clicking on any command in this list will open the help window for that command. Clicking on any subroutine in the list will open the Subroutine Browser displaying the subroutine.
Selecting the "Help" item from the "Help" menu on the menu bar will bring up a JavaHelp browser that provides direct access to and search of this entire help document.
The Edit Window has a popup menu that appears when you right-click (Mac: Ctrl-click) in the window. The same popup will appear in the Debug Window, but the editing functions will be disabled. This popup menu is shown below.
The following are the options that are available from this menu.
Indent Program text Indents any lines enclosed by REPEAT...END, WHILE...END, and IF...END commands to make it easier to read the text. Does not change the case of the commands.
Show/Hide Line Numbers Displays line numbers at the left of each line in the Program Panel. When line numbers are visible, the longer text lines will wrap if the window is too narrow. When line numbers are not visible, the text will not wrap.
Check Program Syntax Performs a syntax check of the contents of the Program Panel. Prints the results of the check in the Output Window.
Run Program Checks the syntax of the program that is in the Edit Window, then if the syntax is correct, runs the program.
Toggle Breakpoint If the Debug tab's window is visible, then this selection changes the debug state of the line containing the cursor from "breakpoint set" to "breakpoint cleared" or vice versa. If the Debug Window is not visible, this item is disabled.
Clear All Breakpoints Clears all breakpoints that are currently set. If no breakpoints are set, no action is taken.
Cut Removes the selected text from the Edit Window and saves it in the clipboard. This item is disabled if Statistics101 is in debug mode.
Copy Copies the selected text from the Edit Window or the Output Window and saves it in the clipboard.
Paste Pastes the text from the clipboard into the Edit Window replacing any selected text or inserting the clipboard text at the cursor in the Edit Window. This item is disabled if Statistics101 is in debug mode.
Paste from Spreadsheet Pastes the contents of the system clipboard into the Edit Window at the cursor. The clipboard contents are assumed to have been copied from a spreadsheet program such as Microsoft Excel by selecting the desired cells in the spreadsheet and choosing Copy (Ctrl-C). For complete details see the "Paste from Spreadsheet" entry under Edit Menu.
Find/Replace... opens a dialog box that
allows you to search the program that is in the Statistics101
editor for a word or words, and optionally replace the found text
with another word or words.
The Debug tab's window can be
searched, but the Replace and Replace All buttons are disabled in
that window, as are all changes.
Find What: Enter the word or words to be found. If you select some text in the editor, you can cause that text to appear in the "Find What:" text box by using Ctrl-F or the Find/Replace menus, whether or not the Find/Replace dialog is already visible.
Replace With: (Optional) Enter the word or words to replace the word(s) found.
Match Case: Check this box to limit the search to only words that have the same capitalization as the "Find What" text.
Whole Words: Check this box to limit the search to match only on complete words, not partial words.
Find: Click this to initiate a search from the current position of the cursor. If there are no matches, the system will "beep".
Replace: Click this button to replace the selection with the "Find What" text and then jump to and select the next match, if any. If there are no more matches, the system will "beep".
Replace All: If you have selected some text in the editor, clicking this button will replace every match of the "Find What" text in the selection with the "Replace With" text. If you have not selected any text in the editor, clicking this button will replace every match of the "Find What" text in the entire editor window with the "Replace With" text.
Include Lib File(s)... Opens a File Selection dialog to let you choose one or more files containing subroutines from the lib directory. After you select one or more file and click Open, an INCLUDE command for each file will be automatically added to the top of your program in the Edit Window. You don't have to choose a file in the lib directory; you can browse to another directory where you might have subroutines and choose a file(s) there.
Help at Cursor (F1) If the cursor is on a word that is the name of a command, then the help browser will display a window containing a complete description of that command. If the cursor is on a word that is the name of a subroutine that is in the lib directory, then the subroutine browser will display the description and code for that subroutine. If the cursor is on a word that is the name of a subroutine defined in the current program, then the editor will scroll to that program's definition and highlight it. If none of the above is true, then the first word on the line (the command or subroutine name for that line) will be described in the help browser, the subroutine browser, or the editor as appropriate. You can also invoke this menu item from the keyboard by using the F1 function key.
Wizard for Command/Subroutine at Cursor (F2) Opens either the Command Wizard Dialog or the Subroutine Wizard dialog depending on whether the cursor is on a line that begins with a command or a subroutine. The form for the command or subroutine on that line will be displayed when the Wizard opens. If the first word on the line is not a recognizable command or subroutine, an error dialog will be displayed. You can also invoke this menu item from the keyboard by using the F2 function key.
Command Wizard (Shift+F2) opens the Wizard window tailored for Commands without regard to the location of the cursor in the editor.
Subroutine Wizard (Ctrl+F2) opens the Wizard window tailored for Subroutines without regard to the location of the cursor in the editor.
(Help) Commands by Name Displays a list of all the Statistics101 commands. Selecting a command will cause a help window to appear with the detailed description of the command. If you hold down the SHIFT key when making the selection, the command will be inserted in your program at the cursor position. If you pause the mouse pointer over any one of the command names, a tooltip will appear describing the command.
(Help) Subroutines from Lib by Name Displays a list of all the subroutines that are in the /lib
directory. Selecting a subroutine will cause a help window to appear
that contains the file from /lib that defined the subroutine so that
you can see its comments and detailed definition. If you hold down
the SHIFT key when making the selection, the subroutine will be
inserted in your program at the cursor position and an INCLUDE
command for the subroutine's file will be inserted at the top of the
program unless an identical one is already there.
(Help) Commands and Subroutines by Category Displays a list of categories, each of which leads to a list of
Statistics101 commands and subroutines from the /lib
directory that are in each category. Commands are shown in bold in
this list, subroutines are shown in plain text. Selecting a command
will cause a help window to appear with the detailed description of
the command. Selecting a subroutine will cause a help window to
appear that contains the file from /lib that defined the subroutine
so that you can see its comments and detailed definition. If you
hold down the SHIFT key when making the selection, the command or
subroutine will be inserted in your program at the cursor position
and if it is a subroutine, then if needed, an INCLUDE
command will be inserted at the top of the program. The above figure
shows this menu fully extended.
If you pause the mouse
pointer over any one of the command or subroutine names in any of the above three menu items, a tooltip
will appear describing the command or subroutine. If you add files
containing your own subroutines to the lib directory, their names
will be added to the list. The first menu item is always "Refresh
List". This item will cause Statistics101 to re-scan
the contents of the lib directory and rebuild the list of subroutine
names. You might need to do this if you added (or removed) a
subroutine file to the lib while Statistics101 was running
because Statistics101 performs the scan at startup and not
again until you request it via "Refresh List".
Print... Prints the contents of whichever tab's window is showing in the Program Panel, as specified by the current Page Setup settings. Line numbers are not printed.
As you are typing your program into the editor, if the cursor is at any point in a word, you can invoke a "hint popup menu" by typing Ctrl-Space (press the Ctrl key and while holding it down, press and release the space bar, then release the Ctrl key). The hint menu will present a list of names from which you can select one to complete the word you are typing. The menu list actually consists of one, two, or three sublists from which you can select a command or subroutine name or a variable name. The first list comprises all the commands and subroutine names (if any) that begin with the letters preceding the cursor. The second list comprises all (if any) of the vector variable names that are "in scope" and match the letters preceding the cursor. The third list comprises all (if any) of the string variable names that are "in scope." If you select an item from the lists, that name will replace the word that contains the cursor. If you want to make no choice, type the Esc key to dismiss the menu. The next figure shows what the popup looks like:
In
the figure, the cursor is just after the "O" of NORMAL in
line 108. Therefore, all the commands and subroutine names that begin
with "NO" are listed. A separator bar divides that list
from the second list, which displays the names of in-scope variables.
"In scope" means that if the cursor is in a word that is
inside a subroutine definition, then only global variables and
variables that exist within that subroutine are listed. If the cursor
is in a word that is not in a subroutine, then only global
variables and variables that are not in a subroutine are
listed. In general, the hint menu system attempts to restrict the
lists to only those names that are valid at the point of the cursor.
Therefore, for example, only variable names will appear in the hint
menu if the cursor is not in the first word on a line, but command
names and variables both will be listed (as in the above figure) if
the cursor is in the first word of a line. Variables are
listed at the first word in case you might want to change the command
into a LET command, which allows a variable to be the first word on
the line.
If you hover the cursor over any entry in the command/subroutine popup list, a tooltip explaining that item will appear. You can see a tooltip in the above figure.
If you use the right or left arrow keys while the hint popup menu is displayed, the cursor will move as directed and the menu will be revised to show matches appropriate to the new cursor position in the word. As you move the cursor left, more choices will appear until you move off the word. As you move it right, fewer choices or no choices will appear. If you type any letter or number key while the menu is displayed, that character will be inserted at the cursor position and the menu will be revised to show the reduced choices based on the new character. You can use the Delete and Backspace keys while the popup is showing and they will have their usual effects.
If the hint menu does not appear when you type Ctrl-Space in the Editor it means that the cursor is not in a word or there is no match for the characters to the left of the cursor, or there is a syntax error in your program that precludes accessing matching variables. You will be warned if your program has a syntax error when you press Ctrl-Space. Since the Debug tab doesn't allow editing at any time, typing Ctrl-Space in that tab's window will not display the hint popup menu. Also, during debug mode, Ctrl-Space is disabled in the Edit tab's window for the same reason.
Note that you must have at least one letter before the cursor for the menu to match against. Matches are only made on command, subroutine, and variable names. The matching process makes up to two attempts to find names that match the letters before the cursor. In the first attempt, it tries to find exact matches, that is, command, subroutine, and variable names that begin with exactly the characters ahead of the cursor. If it succeeds in finding at least one, then it displays the popup menu with those names and doesn't make the second attempt. If it failed to match at least one, then it will attempt to find a "partial" or "fuzzy" match. A partial match is successful when all the characters preceding the cursor are found anywhere in a name and in the same order. Thus, "cds" would match all of these: CHISQUAREDIST, MAKECUMDIST, and SORTCOORD_DESC.
The Output Window has a popup menu that appears when you right-click (Mac: Ctrl-click) in the window.
The following are the options that are available from this menu.
Line Wrap Toggles between line wrapping and not line wrapping. Line wrapping means that all the horizontal text is visible in the window because any text that would have extended beyond the window is put on a new line. If the menu selection has a checkmark at its left, line wrapping is on. Otherwise, and by default, line wrapping is off.
Clear... If there is no selection, deletes the entire contents of the Output Window. Before it deletes the contents it displays a dialog asking you to confirm that you really want to delete them. If you hold down the Shift key while making the selection, the dialog box will be bypassed and the contents will be immediately deleted. If there is a selection, only the selection will be deleted. There is no confirmation dialog for deleting a selection.
Select All Causes the entire contents of the Output Window to be selected. You can then use Ctrl-C or the Copy menu selection to copy the contents to the clipboard. Or, you can use the "Clear..." menu selection to delete the contents.
Copy Copies the selected text from the Output Window and saves it in the clipboard.
Print... Prints the contents of the Output Window as specified by the current Page Setup settings. Line numbers are not printed.
Save As... Saves the contents of the Output Window to a text file.