Prime Numbers.jsl asks the user to enter a number and then factors the number or confirms it as a prime number (图 17.5). This script is a good example of aligning several types of display boxes, concatenating text, and working with conditional functions.
username = uname << Get Text;
<<Modal,
), // Else the number is within range.
p# = N Row( primes );
factors = {}; // Initialize list.
); // End For loop.
); // End If loop.
); // End For loop.
); // End If/Then loop.
); // End while loop.
cfUser0 = Char( fromUser1 );
nf = N Items( factors );
fmsg = "The number you have chosen has the following
fmsg = "The number you have chosen is a prime number: "
<<Modal,
), // End the main OK button script.
图 17.5 Factor Numbers Interactively