Script syntax changes - version 2.00


Welcome     Gallery     Handbook


Manual page for Script_syntax_changes_-_version_2.00(PL)

NEW SCRIPT INTERPRETER

Ploticus release 2.00 debuts a new underlying script interpreter system, with some consequent changes in legal script syntax. These changes should be fairly obscure; when I tested on the collection of gallery examples there were minor problems with 3 or 4 of the examples and these were easily fixed. I appologize in advance for any disruption this may cause.

The following is a summary of known changes; if you find others, please inform me (scg@jax.org).

Changes that may require maintenance to existing scripts:

  • Variables no longer need to be #declared. #declare no longer does anything; if encountered it will be silently ignored. Scripts that depended on #declare to initialize a variable should now use #set or #setifnotgiven instead.

  • #setifnotgiven should be used to set a default value for any variable that may be passed in to the script. Scripts that use #declare soft, $exists(), or $notexists() to handle passed variables should be changed to use #setifnotgiven.

  • References to variables that have never been given a value cause evaluation to be cancelled, leaving the variable name to appear in result, and do not cause an error message to be issued.

  • Concatenation of constants and/or variables is now done differently. You used to be able to do this: #set A = /home/scg/data/@TESTRUN
    Now it must be done this way: #set A = "/home/scg/data/" @TESTRUN

  • Implicit concatentation of constants and/or variables in an #if statement is longer supported. For instance, you used to be able to do this:
    #if @FILENAME = /home/scg/data/@TESTRUN
    Now it must be done this way:
     #set F = "/home/scg/data/" @TESTRUN
     #if @FILENAME = @F
     ...
    
  • #clone no longer accepts a filename argument. Use #include and #procdef instead.

  • The $change() function no longer supports the special symbol space. A space may be represented naturally, eg $change( "_", " ", @FOO )

  • The $validate() function is no longer supported. Scripts should use $isnumber() to test numbers, $datevalid() to test date values, and $timevalid() to test time values.

  • Trailing comments may cause errors where they didn't before. This line contains a trailing comment:
    	rectangle: 1 1 5 6.5    //xlo, ylo, xhi, yhi
    
    The documentation has always stated that "any line beginning with a double slash (//) is taken as a comment", however some of the examples may have used trailing comments. When in doubt don't use them. (added Oct 2 '01)


Changes that should not affect existing scripts:

  • #if statements support quoted operands, useful for constants that have embedded white space. Example: #if @A = "hello world"

  • Function constructs may now contain embedded spaces, and quoted arguments. Exceptions are $arith() and $arithl(), which do not allow embedded spaces within the arithmetic expression.

  • #hideund and #showund directives are no longer necessary, and are silently ignored.


data display engine  
Copyright Steve Grubb


Markup created by unroff 1.0,    October 24, 2001.