Syntax:
INTI <variable>: <format>: <title>; INTI <list of GFUNCTIONS>;This instruction allows the interactive modification of initialized data.
<variable>
is the name of a simple or indexed (with
only one index) arithmetical variable.
If the variable has an index the name must be followed by:
[<lowest value>
.. <highest value>
] that indicates the
range of the array to be changed.
<format>
consists of two integers
<number of places>
: <number of decimals>
. This
defines the format of the values presented to the user.
<title>
is a string of characters without ; or apostrophes
that contains a description of the variable.
This instruction may be used in the INIT and NETWORK but never within GLIDER instructions or I/O instructions.
Examples:
INIT ------------------- Alfa := 1.058; ------------------- INTI Alfa: 9: 2: Scattering angle ;When this instruction is executed, Alfa must have an assigned value. Let it be 1.058 As it appears in the INIT section (see chapter 3), it will appear before the simulation in the screen:
Scattering angle 1.06 C to continue, other to modifyIf C (or c) is pressed, nothing is done and the execution continues. If another key is pressed, it appears:
Scattering angleThe user must write the new value and press enter. For example, if 1.2 is written, then the following appears:
Scattering angle 1.20 C to continue, other to modifyThe user may change this value again. When C or c is pressed, the variable Alfa takes the last assigned value.
ASSI Temp[1..5] := (899.221, 700.037, 988.111, 655.15, 408.599); INTI Temp[1..5]: 8: 2: Furnaces Temperatures;When INTI is executed, it appears in the screen:
Furnaces Temperatures 1 2 3 4 5 899.22 700.04 988.11 655.20 408.60 C to continue, other to modifyIf the user press C or c, it appears:
Modify numberThe user must indicate the number (1 to 5) to be modified. The system asks for the new value. The system rewrites the array modified and asks for new modifications until C or c is pressed.
See examples 1, 6, 8, 9, 10, 13, 14, 16, 18, 19 (GLIDER examples book).
Example:
INIT --------------------------------------------- Poli := 0, 20 / 35, 50 / 45, 70 / 60, 45 / 75, 42 / 100, 50; Spli1 := 0, 20 / 45, 80 / 100, 30; Spli2 := 0, 1 / 5, 10 / 10, 40 / 20, 20 / 40, 30 / 70, 50 / 100, 60; Spli3 := 0, 10 / 20, 40 / 30, 70 / 40, 50 / 70, 30 / 80, 50 / 100, 60; Esca := 0, 20 / 35, 40 / 45, 60 / 60, 45 / 90, 42 / 100, 50; FrecR := 1, 2.5 / 2.3, 4 / 3.2, 3.1; FrecA := 2, 6.5 / 5, 2.3 / 7, 1.1 /9, 2.7; DiscoN := 2, 6.5 / 5, 2.3 / 7, 1.1 / 9,2. 7; DiscoA := Aa, 5 / Bb, 3 / Cc, 4 / Dd, 7; DiscoR := 4.1, 2.2 / 5.3, 4.5 / 6.1, 4.4 / 7.7, 5.5; ----------------------------------------------- INTI FrecR, Poli, Esca, Spli1, Spli2, Spli3, FrecA, DiscoN, DiscoA, DiscoR; _______________________________________________ TYPE Letters = (Aa, Bb, Cc, Dd); VAR Let: Letters; GFUNCTIONS Poli POLYG (REAL): REAL: 7; Spli1 SPLINE(REAL): REAL: 5; Spli2 SPLINE(REAL): REAL: 10; Spli3 SPLINE(REAL): REAL: 10; Esca STAIR (REAL): REAL: 7; FrecR FREQ (REAL): REAL: 8; FrecA FREQ (INTEGER): REAL: 8; DiscoN DISC (INTEGER): REAL: 11; DiscoA DISC (Letters): REAL: 11; DiscoR DISC (REAL): REAL: 10;When the INTI is executed, a graph of
Poli
appears on the screen.
If the user press 2 in the mouse, the system continues displaying
the graph of Spli1
. The XY points indicated in the program are
shown as small circles and the curve is plotted.
When a graph is shown and the user press 1 in the mouse with
the cursor in a point, the following cases may occur:
a) The cursor is on a point of the function. For instance in
the Spli1
the cursor is in X = 45 Y = 80 (or within the circle at
this point). Then this point is deleted and a new graphic without
it appears.
b) The cursor is very near in X to one of the points
but with a different ordinate (Y). For instance in X = 45.003 Y = 63.5
in the example Spli1
. Then the old near X remains but the old Y
is substituted by the new one. In the example the point (45, 80) is
replaced by (45, 63.5). The new graph is displayed.
c) The cursor is clearly away from all XY defined points. Then
if the X is REAL, a new point is introduced. If the X is scalar
or INTEGER the Y is assigned to the nearest X; the Y is changed but
no new X is introduced. For instance, in the case of the DiscoA
function, if the cursor is in a position between Aa and Bb but
near of the Bb and the Y is 7.2, then the point (Bb, 3) is replaced
by the (Bb, 7.2). The new graph is displayed.
The user can introduce many changes one by one, but the total
number of points cannot exceed the maximum declared. In the
example, only up to 2 points can be added to Spli1
.
When 2 is pressed to change to the next graphic, the user has the
option of storing the new values in a file.