What's new in pro Fit 5.5 and 5.6

pro Fit 5.5 screen shot


This document is for experienced pro Fit 5.1 users, and provides a summary of the new features found in pro Fit 5.5, so that they can start to profit from the new version immediately.

Requirements and compatibility

System requirements

proFit is supported on Mac OS® version 8.5 or later. proFit requires at least 2 MByte of free memory (if virtual memory is off it requires at least 4 MByte), however, for normal activities, 5 MBytes are suggested.

pro Fit 5.5 is a Power PC only application. There are no pro Fit 5.5 versions for older machines based on Motorola's 680x0 family of processors. For users interested in running a version of pro Fit on those machines, pro Fit 5.1 is still available. pro Fit 5.5 allows to save most of its documents in pro Fit 5.1 format.

File compatibility

pro Fit 5.5 can import all files from pro Fit 5.1, except preferences files and compiled programs or functions.

New features

New User Interface Experience and better integration with Mac OS 9.0

Date and Time data

pro Fit 5.5 understands and works with time data, i.e. absoulte calendar dates and relative time. There are new column formats in data windows for date&time and relative-time data, and date and time data can be used in data-transforms, graphs, and by user-defined programs and functions.

Technical information

The Mac OS stores dates as the number of seconds since January 1, 1904 (for the technically minded, the date is stored as an integer number, 8 byte long).
pro Fit uses the same convention as the Mac OS to store dates, but uses "double" floating point values instead of integers. With this number representation, pro Fit can store and recognize dates with second precisions until up to 1015 (this corresponds more or less to a 6 byte long integer) seconds after January 1, 1904. .pro Fit can store dates with second-precision up to 31 million years in the future, and it can store dates with day-of-the-week precision up to 3.1 billion years (3 x 109) in the future.
However, the date-time conversion routines currently available in Mac OS 9 only support dates up to 29'940 AD for date-to-string conversions, date-calculations, etc. Up to this limit, pro Fit can store dates with a precision of milliseconds, while it can store dates in the present with a precision of approximately a microsecond.

Preview Window

The preview window has been redesigned. It is now resizeable, and many more options, like the color of the function curve, its thickness, or the size of data points, are user-selectable.

Parameter Window

The parameter window has been redesigned, and now supports up to 128 parameters. It is now possible to paste some parameter values selectively into consecutive parameter value fields by selecting a parameter and pasting tab-separated values.

Predefined functions

The predefined function Spline has more options that can be set by clicking the "Spline Settings" button in the parameter window. There is a new possibility to define the spline curve by using function parameters to set the coordinates of the points on which it is based. This allows, e.g., to fit a Spline function to some set of noisy points, in order to get a smooth guide-to-the-eyes curve. When doing this, be careful not to choose too many points for the Spline-definition.

Data Windows

Drawing Windows

New drawing objects, or shapes

You can now create "control shapes" in drawing windows, such as buttons, checkboxes, radio buttons, popup menus, static texts and edit fields. These new control shapes can be used to create custom interfaces for user-defined programs by switching a drawing window from its normal state to its dialog box state.
This feature allows for a greater degree of customizeability for pro Fit. Developers and pro Fit users can now write useful additions to pro Fit (in the pro Fit definition language itself, or in an external module) with an appropriate and flexible dialog-box interface.
There are already several examples of the new kind of programs and plug-ins that are made possible by the new control-shapes of drawing windows. A simple example is the "Parametric Curve Plotting" dialog box shown below, which allows to plot parametric curves of the kind (x = f(t), y = g(t)) in the current graph (In the example below, f = Sin, g = Gauss).

In order to use a drawing window with control shapes as a dialog box, you must "attach" a program to the drawing window (see below). This program is called when somebody clicks or types into a control.
Controls can only be operated when the drawing window is in "dialog box" mode. To bring a drawing window into this mode, either choose "Get Info..." from the File menu and check "Is dialog window", or click into the drawing window while holding down the control key and choose "Dialog Window" from the contextual menu that appears.
Control shapes (and any other shapes) can be accessed by a program using their names. To view and change the name of a drawing-shape, select the shape and choose "Shape Settings..." from the Draw menu. (You can also double-click most shapes for getting into the corresponding dialog box. When a window is in dialog mode, command-double-click a shape to change its settings.)
A detailed introduction to using control shapes is given below.

Plotting

Bar charts / Histograms


Pro Fit supports two more plotting types: Bar charts and skyline plots.



To use these two types, you choose "Plot Data..." from the "Draw" menu, and then select the desired plot type from the popup menu titled "Plot type". Alternatively, you can change the type of an existing data plot by double-clicking the graph and choosing the "Curves" panel. Several options for bar charts and skyline plots can be set for each graph by double-clicking it and going to the "Bat Charts" panel.

Preferences

pro Fit now looks for/creates a "pro Fit Preferences" folder inside the system's preferences folder. In this folder it looks for a file "pro Fit 5.5 preferences" and creates one if no such file is found. If the "pro Fit Preferences" folder contains a folder named "pro Fit modules", the modules in this folder are linked to pro Fit during start-up.
Various new options have been added to the preferences command:

Numerics Commands

Extrema

The Tabulate Extrema Menu command (in the submenu Analyze of the Menu Calc) now produces a data window which also lists the function value at the extremum, not only the x-coordinate of the extremum. Moreover, it differentiates between maxima and mimina by putting them in two different columns

Binning

pro Fit can now "bin" data, a feature that is useful to create, for example, histograms representing the statistical distribution of some parameter inside a population. "Binning" is the process of putting data into bins, i.e. consecutive intervals. For each data value, the bin or interval it belongs to is determined and the size of the bin is increased by 1. In other words, the number of values in each bin are counted.
Example
You analyze the height of 1000 people. You put all height values into a data window. Now you want to plot a histogram, each histogram bar giving the number of people that have a height in a given 2 cm interval. For this purpose, you choose "Binning" from the Calc menu, choose your data, define bins of 2 cm width, and click OK.

Binning Dialog Box

The bins can be distributed linearly, logarithmically, or according to any other scaling type supported by pro Fit. For example, if you want equidistantial bins, use linear scaling, if you want to have one bin over each decade, use logarithmic scaling, etc.

Debug Window

Remember the time spent pondering about the code for a pro Fit function you wrote, looking for the place where the code could possibly be wrong and not do what you expect?
These times are over. The new debugging window allows to follow the execution of your code step by step and watch all variables and parameter values while you are doing this.
For debugging a program or function, check the option "Debug" at the top of its window. When you run the program or function, its debug window will show up:

Debug window

Now, you can step through your program, view and modify its variables, set breakpoints, etc.
Initially the program stops at the first line of code that is executed. (Note: Some parts of your program may already be called right after compilation, such as the procedure Initialize. In this case, the debugging window will come up right after compilation to let you debug these parts of your code.)

The debug window has four parts:

The top row of buttons lets you control how your code is executed:


You can set "breakpoints" by clicking into the left margin of the source code in the debug window. Red dots mark the breakpoints. To remove a breakpoint, click it again. When you run a program or function and pro Fit encounters such a breakpoint, execution is interrupted and the debug window comes up.

More power for user-defined functions and programs

This section is dedicated to the changes to pro Fit's program and function definition language. There are many new predefined routines available to user-defined functions and programs, providing for a better program-to-program communication (Tags), for more flexibility in number crunching (complex Matrix and Vector types), for time-based calculations (date routines), and for more flexible mechanisms for integrating program-services into pro Fit (programs attached to drawing windows and the possibility of designing a dialog box using pro Fit's drawing tools.).
A short description of the new features is presented first. An alphabetical list of all routines with all details follows later.

Input and Output

Input now allows string expressions for parameter names
SetCurrentWindow() now also works for any function window. Call it for redirecting the output of Write and Writeln calls. Calling SetCurrentWindow(0) resets the text output to the Results window.

Date and time management

pro Fit 5.5 can handle date and time data for all its operations. Global options for formatting such data can be selected with the preferences command. In addition to this, the following routines are provided for converting dates and times to numbers and back.

NumToDateTimeStr, DateTimeStrToNum
NumToRelTimeStr, RelTimeStrToNum

Mathematical operators, functions, and procedures

For your convenience and for special purposes we have added the following mathematical functions and procedures:

mod, div, Even, Odd, BitAnd, BitOr, BitXor, BitNot, BitShift, BitClr, BitSet, BitTst

Complex data types: Matrices and Vectors

The pro Fit definition language for user-defined functions and programs supports new complex matrix and vector types. They are declared like this:

var m: matrix[n];
    v: vector[n];

where n=2, 3, 4. Other values are not supported. m is a nxn matrix whose elements are of type complex. v is a vector of length n whose elements are of type complex. Note that there are no analogies to these types in standard Pascal.
The elements of a matrix m and of a vector v are accessed through the notation: m[i,j], v[i] and can be used with all normal mathematical operators. There are also some special Mathematical Functions used with matrices and vectors:

determinant, transp, adjoint, matr2,matr3,matr4, vect2,vect3,vect4.

These matrix and complex types can be used with normal mathematical operation, when it makes sense. For example one can write

program SomeMatrixAndVectorCalculations;
 var 
   m1,m2: matrix[2];
   mm,mm2: matrix[3];
   v1,v2: vector[2];
   c:  complex;
 begin
  mm1:=matr3(1+ii*2,2*ii,3,4,5,6,7,8,9);
  mm2:=1/mm1;
  m1:=matr1(1,2,3,4);
  m2:=sqr(m1*4.2)+3.3;
  v1:=vect2(1,2+ii);
  v2:=m2*v1;
  c:=v1*v2;
 end;

Mathematical operations between matrices and matrices, matrices and vectors, vectors and vectors, and matrices/vectors with numbers do the expected thing.

Creating and Saving Text files

Some existing routines have been modified to allow to overwrite or append text to existing files, or to handle directories.

CreateTextFile, GetFileDirectoryS, electDirectory, SetDefaultDirectory

Strings

The compiler now interprets two consecutive quotes in a string as a single quote and not as a string terminator. Example: write('don''t') produces the output: don't
In addition to this, pro Fit 5.5 knows new string manipulation routines.

InsertString, CopyStringg

Data Processing

The Bin command in the Calc menu is also available from programs:

BinData

Tags: Sending and getting data from a program.

Tags are pieces of data that can be attached to many different things, and that can be used to store data somewhere, or to pass it to other programs. They offer a more flexible way of inter-program communication than the old GlobalData of pro Fit 5.1.2
Tags can be attached and retrieved from a window, a program, or pro Fit itself. A tag is identified by its name and its value and it can either be a string or a number. Tags are primarily used for passing data to or between programs/functions, for attaching custom data to windows or to pro Fit. Tags are identified by the object they belong to (a program, function, window, or pro Fit itself) as well as by their name. Example:

SetTag(window 'myWindow', tag 'tag 1', value 13); {saves the tag}
GetTag(window 'myWindow', tag 'tag 1', value x); {reads the tag to x}

From Apple script, you can use

get value of tag "tag 1" of window "myWindow"

Attaching programs to drawing windows

Programs can be attached to drawing windows. Such programs are called whenever there is a user-interaction with drawing windows, e.g. when they are clicked, opened, closed, etc. This feature is useful when using the drawing window to design an interface for a program. The attached program can then read the actions of a user, and interpret them.
To attach a program to a drawing window or to modify an attached program, bring the drawing window to front, choose GetInfo from the File menu and check "Show program window". Then click OK. Alternatively click into the drawing window while holding down the control key and choose "Show program window" from the contextual menu. A window with the source of the attached program appears.
Once you have defined the program, choose "Compile" from the Customize menu. The program is compiled and its code is attached to the window.
A program attached to a window (an "attached program") communicates with pro Fit using tags (see below). An attached program should always check its tag msgWhy to find out why it was called. If this tag contains an unknown stringValue, the program should do nothing. Otherwise, it should take some action according to its needs.
The following code-snippet retrieves the "msgWhy" tag:

var msgWhy:String;
...
GetTag(program '', tag 'msgWhy', stringValue msgWhy);

It is also possible to attach a program from another program:

AttachProgram(program 'program attached; ',
program 'begin Beep; end;');
and to add a function or a menu commands from a program, so that the program is called with a specific message if the command is selected from the menu.

AddCommand, CompileText

Plotting

The plotting routines

PlotData, PlotFunction

have acquired some new parameters: dash pattern, colour of the lines connecting data points, the title to be added to a graph, the labels to be used for the x- and y-axes,.the text to be used in the legend, the graph style to be used, the names to be given to graph, legend, and graph-group, the plot type, the fill color, and the direction of filling.

Drawing

Creating or deleting drawing shapes
There are new, more flexible routines for creating drawing objects from within a program:

NewShape, DeleteShape

Working with control shapes

As explained above, drawing windows can contain "control shapes", such as buttons or checkboxes. The following is a list of all control shapes and of the most important properties they have. These properties can be read by calling GetShapeProperty and modified through SetShapeProperties.

Button: These are simple objects that hilite when clicked.



Checkboxes: They automatically change their state when they are clicked.


Radio buttons: They are checked when they are clicked. They usually come in groups.


Text fields: These are shapes that contain editable text. Generally, text fields can be edited.


Static text fields: These are shapes that contain non-editable text.


Popup menus: Popup menu shape have several "values" which can be selected by choosing them from a pop-up menu.


Wells: These shapes are usually used as background for other objects, e.g. a graph. They consist of a white rectangle.

In order to learn how to use and control these new shapes, see the the "What's new in pro Fit 5.5" document.

Getting and Setting "Properties" of various pro Fit objects

pro Fit 5.5 supports a general mechanism to retrieve or set various properties of various objects, such as the coordinates of shapes in a drawing window, the title or size of a window, etc. There are routines that provide access to the properties of drawing shapes, windows, function and programs, and pro Fit itself.

SetShapeProperties, GetShapeProperty
generic routines for checking, and changing any type of shape in a drawing window. (Every object in a drawing window, e.g. rectangles, groups, graphs, legends, etc, is a shape.)

SetWindowProperties, GetWindowProperty
set or retrieve the info-text, size, title, position, etc. of a window.

SetDataWindowProperties, GetDataWindowProperty
get and set the number of columns and rows in the current drawing window.

SetFunctionPropertiesGetFunctionPropertySetProgramProperties,GetProgramProperty
get and set function and program options, hide/show function in preview window

SetOptions, GetOption
set and retrieve various options of pro Fit.

New Pre-defined Procedures & Functions

Pro Fit 5.1 definesk many new pre-defined procedures and functions that can be used from user-defined functions and programs. An alphabetical list of all procedures and functions which are either new or that provide new functionality in pro Fit 5.5 can be found in the "What's new in pro Fit 5.5" document.