Search processing.org:

Reference for Processing version 1.0.1+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

Name

### param()

Examples

    void setup() {
      size(100, 100);

      // Read the value "51" from the following text embedded in an HTML page:
      // <applet code="param_example" archive="param_example.jar" width=100 height=100>
      // <param name="back" VALUE="51">
      // </applet>
      String bgcolorStr = param("back");
      int bgcolor = int(bgcolorStr);
      background(bgcolor);
    }

Description | Reads the value of a param. Values are always read as a String so if you want them to be an integer or other datatype they must be converted. The param() function will only work in a web browser. The function should be called inside setup(), otherwise the applet may not yet be initialized and connected to its parent web browser.

Syntax

    param(s)

Parameters

s | String: name of the param to read

Returns | String
Usage | Web

Updated on November 22, 2008 08:39:26pm PST