The syntax for PCScript commands follows a convention similar to that of object-oriented languages such as C++ or Java. Each command consists of three partsan object, method, and list of parameters. The code below shows the syntax for a PCScript command.
Objects are created and named in the PopChart appearance file (see "About Appearance Files" in Chapter 1 of the PopChart Builder User Guide). PCScript commands use the object names specified in the appearance file. For more info on object names, refer to "What is my Object Named?" in Chapter 6 of the PopChart Server User Guide
The number of parameters for each command will depend on the method. Each parameter will be separated by the parameters delimiter (refer to the Main. ParamDelimiter method), which is usually a comma. For example, consider the addPopupText method for Graph objects. This method accepts three argumentstwo numbers and a string. An addPopupText method call would appear as follows:
graph.addPopupText(1, 2, This is the PopUp Text)
Note: Strings in PCScript do not have quotation marks around them. Because of this, if you have a comma or semi-colon in your string, PopChart Server will not be able to interpret your string correctly. You can get around this problem by changing the parameter or item delimiters using the Main. ParamDelimiter or Main. ItemDelimiter command.
Note: PCScript commands are not case sensitive.
A complete list of object and method types is available in the "PCScript Reference" section at the end of this chapter.
To help shorten the length of the PCScript Command String, many methods accept more than one set of parameters per method call. In this case, each set of parameters is separated by the item delimiter (refer to the Main. ItemDelimiter method), which is usually a semi-colon. The syntax for such statements is:
object.method(parameter_list [;parameter_list]*)
For example, consider a PCScript command string that contains several graph.addPopupText method calls, as in the example below.
graph.addPopupText(1-4,1,Hello World)
graph.addPopupText(1-4,2,Foo Bar)
graph.addPopupText(1-4,3,Goodbye)
These PopUp text items could be specified in one method call instead of three:
graph.addPopupText(1-4,1,Hello World;1-4,2,Foo Bar;1-4,3,Goodbye)