Script syntax changes - version 2.00


Version 2.42 May2013




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.

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 in #set statements are 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
    ...
    
    The $system() function is no longer supported, since the new script interpreter has #shell for issuing shell commands and capturing the results, including multi-row results. For example, this old code:
      #set dir = $system(pwd)
    
    can be replaced with the following:
      #shell #processrows pwd
      #call $shellrow( dir )
    
    Spaces may be freely used in the #shell command. (this item added Mar 26 '02)

    Resource utilization limits have been added as a safety feature for automated situations. By default pl (and any other process it initiates) are limited to 10 cpu seconds and 5MB of created disk space. When a process exceeds a limit, a core dump occurs. These limits can be raised via proc settings or a config file. Or, you can remove the safety limits altogether by making an adjustment in the Makefile (see step 3) and then do make clean and then make.

    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. (this item added Oct 2 '01)

    #clone no longer accepts a filename argument. Use #include and #procdef instead.


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


Ploticus is hosted at http://ploticus.sourceforge.net   Get ploticus data display engine at SourceForge.net. Fast, secure and Free Open Source software downloads