The SiMPLE
System Library


(Abridged)



( Simple Modular Programming Language & Environment )



The following is an abridged list of some of the more frequently used tasks and functions contained in the system library.




Task:                    Description:

Circle (x,y,r)           Draws a circle of radius r [in the current Linecolor],
                         centered at location (x,y).

Cls
Cls (color)              Clears the screen to the specified color. (If no color is
                         specified, clears the screen to black.)

Cuckoo                   Generates a "Cuckoo" sound. [Works only in the Ultra-SiMPLE
                         universe]

Delay (milliseconds)     Delays for the specified number of milliseconds.

Drip                     Generates a "Drip" sound. [Works only in the Ultra-SiMPLE
                         universe]

Ellipse (x,y,a,b)        Draws an ellipse [in the current Linecolor], centered at
                         location (x,y), with x-radius = a and y-radius = b.

Ellipse (x,y,a,b,ang)    Draws an ellipse [in the current Linecolor], centered at
                         location (x,y), with x-radius = a, y-radius = b, and rota-
                         tion angle = ang.

Filledcircle (x,y,r)     Draws a filled circle of radius r [in the current Linecolor
                         and Solidcolor], centered at location (x,y).

Filledellipse (x,y,a,b)  Draws a filled ellipse [in the current Linecolor and Solid-
                         color], centered at location (x,y), with x-radius = a, and
                         y-radius = b.

Filledrectangle (xul,yul,xlr,ylr)    Draws a filled rectangle [in the current Line-
                                     color and Solidcolor] whose upper left-hand
                         corner is located at (xul,yul) and whose lower right-hand
                         corner is located at (xlr,ylr).

Filledsquare (x,y,r)     Draws a filled square of radius r [in the current Solidcolor],
                         centered at location (x,y).

Graphoff                 Turns graphics mode off if it isn't already off.
                         [Works only in the Pro-SiMPLE universe]
                                                                       
Graphon                  Turns graphics mode on if it isn't already on.
                         [Works only in the Pro-SiMPLE universe]

Htab (x)                 Horizontal tab to the specified column on the text screen.

Hidemouse                Removes the mouse pointer from the screen.

Honk                     Generates a "Honk" sound. [Works only in the Ultra-SiMPLE
                         universe]

Line (a,b,x,y)           Draws a straight line [in the current Linecolor] from loca-
                         tion (a,b) to location (x,y).

Linecolor (color)        Specifies the color to be used for drawing lines.

Nosound                  Turns off any sound currently being played through the com-
                         puter's built-in speaker. [Works only in the Pro-SiMPLE
                         universe]

Output
Output (info)
Output (info,n)          Displays the specified information (of any type) either onto
                         the screen, or into an output text file named "output" (in
                         the current project), depending on the mode of outputting
                         currently established. (See the Outputmode task below.)
                         If n is supplied, tabs right n spaces after outputting.
                         If n is not supplied, an automatic carriage return is gener-
                         ated after outputting. If no calling parameters at all are
                         supplied, only a carriage return is generated.  

Outputmode (mode)        Sets the mode for the Output task (see above).
                         Enter with:

                            mode=1, send all output to the screen [default].
                            mode=2, send all output to a file named "output"
                                    in the local folder. [When using SiMPLE
                                    in "Drag & Drop" mode, the path to the
                                    "output" file is: \simple\project\output]
                            mode=3, send all output to the screen and to the
                                    "output" file.

Plot (x,y)               Plots a pixel [in the current Pointcolor] at location (x,y).

Pointcolor (color)       Specifies the color to be used for plotting points.

Pop                      Generates a "Pop" sound. [Works only in the Ultra-SiMPLE
                         universe]

Quit                     Terminates execution of a program.

Randomize                Initializes the random number generator to a random starting
                         value.

Rattle                   Generates a "Rattle" sound. [Works only in the Ultra-SiMPLE
                         universe]

Readmouse (x,y,button)   Reads the current location of the mouse and returns it in
                         (x,y). Also returns the status of the mouse buttons. (1 =
                         left button pushed, 2 = right button pushed, 3 = both but-
                         tons pushed)
                                         
Readquitkey
Readquitkey (key)        Tests to see if the specified key on the keyboard has been
                         pressed. If so, the program immediately terminates. If no
                         key is specified, program execution terminates if any key
                         on the keyboard is pressed.

Rectangle (xul,yul,xlr,ylr)    Draws a rectangle [in the current Line color] whose
                               upper-left corner is located at (xul,yul) and whose
                         lower-right corner is located at (xlr,ylr).

Showmouse                Makes the mouse pointer visible on the screen.

Snip                     Generates a "Snip" sound. [Works only in the Ultra-SiMPLE
                         universe]

Solidcircle (x,y,r)      Draws a solid circle of radius r [in the current Solidcolor],
                         centered at location (x,y).

Solidcolor (color)       Specifies the color to be used for drawing solid shapes and
                         filled shapes.

Solidellipse (x,y,a,b)   Draws a solid ellipse [in the current Solidcolor] centered at
                         location (x,y), with x-radius = a and y-radius = b.

Solidrectangle (xul,yul,xlr,ylr)    Draws a solid rectangle [in the current Solidcolor]
                                    whose upper-left corner is located at (xul,yul) and
                         whose lower right corner is located at (xlr,ylr).

Sound (frequency)        Starts playing a tone of the specified frequency through the
                         computer's built-in speaker. [Works only in the Pro-SiMPLE
                         universe]

Solidsquare (x,y,r)      Draws a solid square of radius r [in the current Solidcolor],
                         centered at location (x,y).

Square (x,y,r)           Draws a square of radius r [in the current Linecolor],
                         centered at location (x,y).

Tabxy (x,y)              Sets the cursor position to the specified x and y position on
                         the text screen. [The upper-left corner of the screen is x=1,
                         y=1.]

Twing                    Generates a "Twing" sound. [Works only in the Ultra-SiMPLE
                         universe]

Vtab (y)                 Vertical tabs to the specified line on the text screen.
                         [Line 1 is the top of the screen.]

Waitkey
Waitkey (key)            Waits for the specified key on the keyboard to be pressed.
                         If no key is specified, waits for any key on the keyboard to
                         be pressed.

Waitquitkey
Waitquitkey (key)        Waits for the specified key on the keyboard to be pressed,
                         then terminates the program. If no key is specified, program
                         execution terminates when any key on the keyboard is pressed.


Function: Description: Dabs (x) Fabs (x) Returns the absolute value of x as a floating point number. Decimal (x) Float (x) Returns the value of x as a floating point number. Getpixel (x,y) Returns the color value of the pixel located at (x,y). Keyhit ( ) Returns the value 1 if a key has been pressed, or the value 0 otherwise. Keyindecimal ( ) Keyindecimal (message) Keyinfloat ( ) Keyinfloat (message) Displays a prompt message on the screen, and then waits for the user to type-in a floating point number. (The message parameter is optional.) Keyinint ( ) Keyinint (message) Keyinwhole ( ) Keyinwhole (message) Displays a prompt message on the screen, and then waits for the user to type-in an integer number. (The message para- meter is optional.) Random (n) Returns a pseudo-random whole number in the range: 0 through n-1. Readkey ( ) Readkey (key) Reads the keyboard. If the specified key has been pressed, the value of the key is returned. If any other key (or no key) has been pressed, the value 0 is returned. If no key is specified, pressing any key will return that key's value. Sqrt (x) Returns the square root of x. Wabs (x) Iabs (x) Returns the absolute value of x as an integer number. Waitkey ( ) Waitkey (key) Waits for the specified key on the keyboard to be pressed and then returns its value. If no key is specified, waits for any key on the keyboard to be pressed and then returns its value. Whole (x) Int (x) Returns the value of x as an integer number. Xpixels ( ) Returns the current horizontal screen resolution (in pixels). Ypixels ( ) Returns the current vertical screen resolution (in pixels).


The SiMPLE CodeWorks, Inc.
www.simplecodeworks.com