Welmat Programming Language - WPL --------------------------------- General WPL script information ------------------------------ A WPL script is a text file that is read in line by line by a routine that will try to analyse the line into a valid WPL statement. When these lines are parsed, they are parsed into a format of: [label:] command [parameter] [parameter] [parameter] ... where the 'label' is a string of alpha-numerics a maximum of 30 characters in length (and is terminated by a colon ':'). A command is any WPL command that is known to the parser at the time the file is being parsed, and the parameters are a given number of text strings where the number is specific to each WPL command. Before looking up the command it first checks if the first character is a ';' (semicolon) or a '#' (octothorp). If it is, the rest of the line is 'thrown out' as being a comment. (NOTE: If there was a label on the line before the comment, the label is valid). A blank line, lines with comments, or parameters beyond the number required by the function are just thrown out as 'useless information' and are not kept by the WPL parser. Strings within WPL are a generic concept used by every function in the language. When I say a function takes '3 parameters' I mean that it takes three of these 'WPL strings'. Now, since the space character is used to separate parameters, if you want to send an actual 'space' character, you must put your string within quotes. Now that you're using the double quote " character to form the string, if you want to put an actual QUOTE character within a string, you must escape it by doing \" (Yes, just like what was done in WCompile's config files). Now that you have this escape character, if you want to put a '\' in the string, you must escape the escape character and use \\. Some other special escape characters exist: \n - Newline (Same as Linefeed) \r - Return character \### - send the Octal (base 8) character given by the three digits following the slash. WPL string variable substitutions: ---------------------------------- There is a general function used to find the value of a string within WPL (the WPI command is called wpi_getstring()) that allows for many runtime substitutions of the value of various types of variables. Variable types are signified by the $ character, and then the variable name is bracketed by a special set of characters, one to begin the bracket, and one to end. The bracketing character itself determines what type of variable is used. To add a '$' chracter itself to the string, use two $ characters one after the other. $() - WPL variable set with the 'Set' WPL command ${} - AmigaDOS ENV: global variable, set with the 'SetEnv' WPL command. $[] - AmigaDOS SHELL local variable, set with the 'SetVar' WPL command. $<> - WPI read-only calculated variables. These variables are calculated at the time that their value is requested. Currently, the calculated variables are as follows: $ - Counts the number of REXX abort messages awaiting WPL to exit. This is used as a boolean that when true ( > 0) will signify that a WPL script should attempt to exit. These messages will be replied to only once the last slave has closed. $ - substitutes the date in dd-mm-yy format. This will be localized at a future point. $ - substitutes the unique REXX compatible message port name that identifies the current slave. $