Fundamentals of NewtonScript
myFunctions:ReverseArray([3, 5, "abc"]) --> ["abc", 5, 3]A QuickTime movie of the solution is available.
2. In the Inspector, write a function that takes an array of numbers as a parameter and returns the total of the numbers. For example:
myFunctions:TotalOfArray([3, 5, 7]) --> 15A QuickTime movie of the solution is available.
3. In the Inspector, write a function that takes as a parameter a frame whose slots contain numbers and returns the total of the numbers. For example:
myFunctions:TotalOfFrame({x: 7, y: 16, z:20}) --> 43A QuickTime movie of the solution is available.
4. In the Inspector, create a frame object containing a Next
method that returns successive odd numbers. For example:
oddNumbers:Next() --> 1 oddNumbers:Next() --> 3 oddNumbers:Next() --> 5A QuickTime movie of the solution is available.
5. In NTK, create an application that contains a text button. Tapping on the button should print out the current date and time to the Inspector.
Time()
returns the current date and time as an integer. DateNTime(Time())
returns a string containing the current date and time in human-readable form.
An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.
Last modified: 1 DEC 1996