Delphi™ for Windows
Copyright © 1983-1995 Borland^® International, Inc.

 Delphi Component : Optimized Script Support API
DCOSSAPI.DCU & BPOSSAPI.DLL Copyright ^© 1995, Greg Truesdell
All Rights Reserved Worldwide

DCossAPI.DCU is a Delphi component wrapper for the optimized script support library in BPossAPI.DLL.  This library includes the following integrated functions:

• Text and language parsers
• Keyword/token definition and recognition 
• Symbol table (variable) definition and recognition
• Symbol-aware expression evaluators

The library originally designed for Visual Basic was modified for Borland Pascal, then enhanced for Delphi.  The component TScriptParser was then built to wrap around the DLL interface.

 You can contact me at any of the following locations:
CompuServe ID	74131,2175
Internet Address	74131.2175@compuserve.com
Surface Mail		Ste. 308 - 633 North Road, Coquitlam BC, CANADA, V3J 1P3

 Neither Greg Truesdell or DCOSSAPI are directly associated with Borland International, Inc.

Table of Contents
Table of Contents	
Figures	
Tables	
Introduction	
The Beta Test Program	
Responsibilities and Advantages	
Registration	
Getting Started	
Installing DCossAPI on your Hard Disk	
Adding TScriptParser to DELPHI	
Adding TScriptParser to your Project	
First Look - Properties, Events and Methods	
Properties	
Runtime Properties	
Events	
Methods	
Constants Reference	
Constants defined in DCOSSAPI.DCU	
Limitations	
AddKeyword and Set/AddVariable Error Codes	
NextToken Error Codes	
Expression Evaluation Error Codes	
Variable Types	
Operator Character Tokens	
Exceptions	
Introduction	
Exception Types	
EInvalidToken	
ENoKeywords	
ENoText	
EInvalidVariable	
ENotExecuting	
EInvalidLine	
Event Handler Reference	
Event Types	
TCancelEvent	
TErrorEvent	
TNewLineEvent	
TLineEvent	
TNumExprEvent	
TStrExprEvent	
TTraceEvent	
Parsing Events	
OnAlphaParse	
OnNextParse	
OnProcedure (not yet implemented)	
OnTrace	
OnTypedVar	
Error Events	
OnBadToken	
OnError	
Text Events	
OnEndOfLine	
OnEndOfText	
OnNewLine	
Expression Evaluation Events	
OnEnterStrExpr	
OnNumExprLoop (Formerly OnEnterNumExpr)	
OnStrExprLoop	
Method Reference	
Token/Keyword Parsing Methods	
GotoLocation	
IsKeyword	
IsToken	
LocateKeyword	
LocateTextAt	
NextToken	
ParseWhileIn	
PeekNextToken	
TokenInSetOf	
Numeric and String Evaluation Methods	
Evaluate	
EvalNumeric	
EvalString	
ExprType	
TestNumExpr	
Variable Related Methods	
AddVariable	
GetVariable	
PeekVariable	
SetVariable	
VariableCount	
ZapVariable	
ZapVariables	
ZapVariablesFrom	
Keyword Definition Methods	
KeyList.AddKey	
AddKeyword	
GetKeyword	
GetKeywordToken	
GetTokenKeyword	
KeywordCount	
LoadKeywords	
NT_CodeString	
SaveKeywords	
ZapKeywords	
Special Utility Methods	
DefTokenDelims	
NT_Operators	
Label Methods	
AddLabel	
GotoLabel	
ScanForLabels	
String and Numeric Function Registration Methods	
RegisterFunction	
RegisterNumeric	
Exported Generic Parsing Functions	
CGetWordAt/PGetWordAt	
CLocateWord/PLocateWord	
CPackSpaces/PPackSpaces	
CParseStr/PParseStr	
CParseUntil/PParseUntil	
CWordCount/PWordCount	
Copyright Information	
Index	

Figures
Figure 1 - Object Inspector View of Properties	
Figure 2 - Object Inspector View of Events	
Tables
Table 1 - Visible Properties	
Table 2 - Runtime Properties	
Table 3 - Event Descriptions	
Table 4 - Limitation Constants	
Table 5 - AKW Error Code Constants	
Table 6 - NextToken Event and Error Codes	
Table 7 - Expression Evaluation Error Codes	
Table 8 - Variable Types	
Table 9 - Operator Character Codes	
Table 10 - OnEnterStrExpr Passed Arguments	
Table 11 - OnNumExprLoop Passed Arguments	
Table 12 - OnStrExprLoop Passed Arguments	
Table 13 - AddVariable Constants	

Introduction

From time to time a programmer wishes to provide a scripting language to accompany the program under development.  It may be a communications, word processing, database access or other program.  Building a fair scripting language can be quite a chore ... a project all by itself.  In my business I have been called to do this a number of times, recreating the wheel over and over in different languages.  Eventially it occured to me to build a scripting library into a DLL that could be used by a number of languages.  This project became VBOSSAPI.DLL; a DLL designed specifically for Visual Basic.  With minimal effort it was modified for Borland Pascal, and now Delphi.

Although I had considered wrapping the DLL in a VBX for Visual Basic, I never got around to needing call back capabilities in my Visual Basic projects.  Then along came Delphi.  I had begun a new application for an SQL server and needed a batching language. Since VBOSSAPI.DLL was written in Borland Pascal 7, it seemed like a logical step to build a component for Delphi.  And, of course, I was being prodded by a few people who said they would really like a Delphi component version of VBOSSAPI.DLL.

The component project (now called DCOSSAPI) has now reached the point (after much testing and experimenting) that I can consider offering it to you as a Beta Test product.

In earlier builds (1..5) of DCossAPI the parser library BPossAPI.DLL was required.  As of Build 6 this is no longer an issue.  The entire contents of BPossAPI.DLL have been incorporated into DCossAPI .. resulting in a faster, simpler and safer implementation.

In this document I hope to provide enough information for you to evaluate and beta test the TScriptParser component.  In the fullness of time I will provide a Windows Help file linked appropriately to the Delphi visual development environment.

The Beta Test Program
Responsibilities and Advantages

By joining in on the Beta Test program for DCOSSAPI you will receive a number of advantages.  In return I hope that you will stay in communication with me concerning problems, enhancement requests and submissions.

For the duration of the Beta Test program, I will be keeping in touch with you (and you with me) via E-Mail.  Updates will be posted regularly via the CompuServe Delphi Forum.  When you register you will receive a Beta Testers Password that you must use to UNZIP the update archives.  After the Beta Test program is complete, you will receive the complete package registered to you from the day I send it to you.  This means your one year free updates and technical assistance will begin on that day.

The more you participate, the better the product becomes.  Beta Testers will also be offered the complete component source code at an attractively low price.  It will become available shortly after the product is put into general release.  I have no immediate plans for releasing the source code for the DLL.  However, much of the magic has been imbedded into the component.

Registration

The Beta Test program price is US$49 complete (no shipping and handling charges.)  The general release version of the product is expected to be priced between US$70 and US$100.  By joining the program and helping me to improve the product you get the special price and the special attention.

If you are interested in joining then GO SWREG and search for SWREG# 6983 on CompuServe.

Getting Started

Installing DCossAPI on your Hard Disk

The entire DCossAPI package is distributed in a single ZIP archive.  To install DCossAPI you should create a new directory (say ... C:\DCOSSAPI) and unzip the archive into that directory.  You will need to use the PKUNZIP -d DCOSSREG command to create the sub directory structure stored in the archive.  Once completed you should have the directory structure below:

C:\DCOSSAPI			Root Directory
C:\DCOSSAPI\DOC		Documents etc.
C:\DCOSSAPI\EXAMPLES	The sample application(s)
C:\DCOSSAPI\LIB		DCR,DFM and DCU files

During the Beta Test program, it's a good idea to retain this directory structure as new updates to registered Beta Testers will place updated files in appropriate (or even new) directories.  Some sample programs may depend on a certain structure.

Adding TScriptParser to DELPHI

Assuming that you want to add this component to your currently selected component library,  use the following list as a guide to adding this component (you can, of course, ignore this whole section if it is obvious to you.)  For purposes of clarity I am assuming that the base directory is C:\DCOSSAPI.

	Select Options|Install Components... from the Delphi main menu.
	Under Search Path: append the DCOSSAPI library directory (C:\DCOSSAPI\LIB)
	Press the Add button and under Module Name: type C:\DCOSSAPI\LIB\REGSCRIPT.DCU or use the Browse button to locate the DCU file.
	Select the OK button, then the OK button on the next dialog and away you go. The TScriptParser and TBasicInterpreter icons will be added to the Script group.

	If you cannot install the component, then please send me an E-Mail message describing the problem and I will investigate.

Adding TScriptParser to your Project

You only need to add TScriptParser to your project once.  The DLL knows only which application owns it.  Any number of applications can access the DLL, but any additional instances of TScriptParser in a single application will assume the same Keyword/Token database and Symbol Table.  It can lead to confusion if you add the component to a project more than once.

First Look - Properties, Events and Methods

Properties

Here, in Figure 1, is a snapshot of the Object Inspector entries for TScriptParser.  The Beta Test version includes ten properties.  Strictly speaking, not all properties that are accessible during execution are listed here.  But this is a good place to start.

Figure 1 - Object Inspector View of Properties

Then properties are defined in Table 1 below: (note that ScriptID is no longer valid and will be removed from coming versions of DCossAPI.  This is because BPossAPI is no longer required or needed.)

Table 1 - Visible Properties
PROPERTY | TYPE | DESCRIPTION
About | String | Copyright Message
AlphaParse | Boolean | When set to TRUE, this property changes the parsing engine’s default context from multiple-character keywords to single characters.  Any alphabetic character will activate the OnAlphaParse event instead of the OnNextParse event.
CurrentIndex | Integer | Contains the current line index (character position within the line).  Usually points to the next character after the keyword.
CurrentLine | Integer | Contains the current line number.
DebugTrace | Boolean | Set to TRUE to enable the debug tracing event OnTrace

Exceptions

Boolean

This toggle is used to enable (true) or disable (false) the generation of exceptions during parsing.  
When set False, you must check for errors yourself.
When set True, TScriptParser will generate an exception if an error occurs.

Execute

Boolean

Use Execute := True to start parsing the script.
Use Execute := False to stop parsing the script.

KeyList | TKeywordList |
KeyWord | String | The current KeyWord text.
LineText | String | The text of the current line being parsed.
Name | String | Name of the control (TComponent)

ScriptID

Integer

BPossAPI.DLL Script Identifier
Obsolete after Build 5

Tag | LongInt | Not used (TComponent)
Text | TStrings | Script to execute.
Token | Integer | Current Token value of KeyWord.
VarList | TVarList | Read-Only view of currently defined variables (under construction)
Version | String | Current version of the Component

Runtime Properties

In general, these properties only have meaning after NextParse is called or the OnNextParse event.

Table 2 - Runtime Properties
PROPERTY | TYPE | DESCRIPTION
AsFloat | Extended | Returns the current keyword as a float value.
AsInteger | LongInt | Returns the current keyword as a long integer value.
AsString | String | Returns the current keyword as a string.
AsVarType | Integer | Returns the current keyword's variable type.
LineText | String | Returns the entire current line's text.

Events

Below are the Object Inspector Event entries for TScriptParser. This picture was taken from the sample project included with the package.

Figure 2 - Object Inspector View of Events

The following table describes the set of events available once the Execute property is set on.  Note that BOLD indicates primary events, NORMAL indicates support events and ITALICS indicates under construction.

Table 3 - Event Descriptions
EVENT | DESCRIPTION
OnAlphaParse | Triggered when the parser is in AlphaParse mode and a alphabetic character is encountered.
OnBadToken | Occurs when a unrecognized token is encountered.
OnEndOfLine | Triggered when the end of a line is reached.
OnEndOfText | Triggered when the end of the script is encountered.
OnEnterStrExpr | This event is triggered whenever a string expression is encountered.  OnEnter* events occur before the expression is evaluated.  This allows the programmer to define special behaviors and string functions.  See RegisterFunction().
OnError | Triggered by most errors.
OnNewLine | Occurs whenever a new line is encountered.
OnNextParse | This is the main workhorse event.  Once started, the parsing engine activates this event each time a new element is parsed.
OnNumExprLoop | This event is triggered whenever a numeric expression is encountered.  In this event's handler the programmer can add and intercept special numeric functions or constants. See RegisterNumeric()
OnProcedure | Triggered when a Token of type NT_PROCEDURE is encountered.  Currently under construction.
OnStrExprLoop | This event is special to string evaluation.  Strings can be concatenated using the '+' operator.  As the string evaluation parser is parsing the expression, this event is called to allow the programmer to define special behaviors and string functions.  See RegisterFunction().
OnTrace | Enabled when the DebugTrace property is set to TRUE.
OnTypedVar | This event is called whenever a Typed Variable (string, integer, float) is encountered.  It's primary use is to allow the programmer to handle 'free floating' variable equates. (i.e. Title = "My First Book").

Methods

The following table is a snapshot of the contents of Delphi's Symbol Browser for TScriptParser. It is a complete listing of all public methods available:

Each method will be covered in more detail in the reference section of this document.  Methods are provided for the following purposes:

	Keyword definition, loading and saving, locating in the text, testing and parsing.
	Token testing, registration, decoding and parsing.
	Variable definition, setting and getting, counting and evaluating.
	Numeric and String expression evaluation.
	Label detecting and branching.
	Housekeeping.

Constants Reference
Constants defined in DCOSSAPI.DCU

The following charts detail the constants exported by the DCOSSAPI.DCU library.

Limitations
Table 4 - Limitation Constants
CONSTANT | VALUE | DESCRIPTION
MAX_KEYWORD_LEN | 32 | Maximum length of a keyword.
MAX_KEYWORDS | 600 | Maximum number of keyword definitions.

AddKeyword and Set/AddVariable Error Codes

AddKeyword, SetVariable and AddVariable return error codes if an error occurs.  Normally these functions will return 0 if successful.

Table 5 - AKW Error Code Constants
CONSTANT | VALUE | DESCRIPTION
AKW_NO_MORE_ROOM | -1 | Token/Keyword database full.
AKW_INVALID_CHAR | -2 | An attempt to include an invalid character in the keyword was detected.
AKW_DUPLICATE_KEYWORD | -3 | Keyword already exists.
AKW_KEYWORD_TOO_LONG | -4 | Keyword was greater that MAX_KEYWORD_LEN characters long.
AKW_INVALID_TOKEN | -5 | Token value assigned is invalid.
AKW_TYPE_MISMATCH | -6 | Returned by Set/AddVariable if the data type is incompatible.
AKW_OVERFLOW | -7 | Returned by Set/AddVariable if the data value has overflowed the variable.

NextToken Error Codes

Some of the error codes below are not currently useful but will be implemented later.  These are indicated in ITALICS.

Table 6 - NextToken Event and Error Codes
CONSTANT | VALUE | DESCRIPTION
NT_PAST_EOF | -1 | Reached end of the text.
NT_NO_KEYWORDS | -2 | Attempt to run the script without defining any Keywords.
NT_TOKEN_NOTFOUND | -3 | Current keyword is not a recognized token.
NT_NO_FREE_MEMORY | -4 | Not enough memory to complete current function.
NT_VARIABLE_FOUND | -5 | A variable was encountered.
NT_LABEL_FOUND | -6 | A Label was encountered.
NT_FUNCTION | -7 | A Function was encountered.
NT_PROCEDURE | -8 | A Procedure was encountered.
NT_NUMERIC_CONSTANT | -9 | The current Keyword is a numeric constant.
NT_STRING_CONSTANT | -10 | The current Keyword is a string constant.
NT_MATH_FUNCTION | -11 | A registered math function was encountered.

Expression Evaluation Error Codes

These codes are returned by the expression evaluator when an error occurs.  The constants displayed in ITALICS are generally used internally.  It should also be noted that TScriptParser translates these errors into text for you.

Table 7 - Expression Evaluation Error Codes
CONSTANT | VALUE | DESCRIPTION
EXPR_EXTERNAL_CALL | -1 | A registered external call was made.
EXPR_SYNTAX_ERROR | 1 | Syntax error.
EXPR_PARAMETER_MISSING | 2 | A parameter was missing in an internal function.
EXPR_PARAMETER_COUNT_ERROR | 3 | Wrong number of parameters passed in an internal function.
EXPR_INVALID_PARAMETER | 4 | Parameter type is invalid.
EXPR_OVERFLOW | 5 | Numeric expression resulted in an overflow.
EXPR_COMMA_MISSING | 6 | A comma was missing in a function call.
EXPR_MISSING_RPAREN | 7 | ')' missing.
EXPR_TYPE_MISMATCH | 8 | Parameter passed was not the right type.
EXPR_INVALID_IDENTIFIER | 9 | Invalid identifier.
EXPR_PARAMETERS_NOT_ALLOWED | 10 | A function requiring no parameters was passed parameters.
EXPR_EXPECTED_FACTOR | 11 | A Factor was expected. (*/)
EXPR_EXPECTED_TERM | 12 | A Term was expected. (+-)
EXPR_EXPECTED_EXPRESSION | 13 | An expression was expected.
EXPR_ZERO_DIVIDE | 14 | Divide by Zero error.
EXPR_OUT_OF_MEMORY | 15 | Out of memory.
EXPR_GARBAGE_FOLLOWS | 16 | The expression was not terminated properly.
EXPR_VARIABLE_EQUATE_ERROR | 17 | Internal variable equate error.
EXPR_INVALID_VAR_OR_FUNC | 18 | Invalid internal function or variable encountered.

Variable Types

The following values are passed to and returned by various methods:

Table 8 - Variable Types
CONSTANT | VALUE | DESCRIPTION
VNONE | 0 | Undefined.
VSTRING | 1 | A 0..255 character string.
VINTEGER | 2 | A Long Integer value.
VFLOAT | 3 | An Extended decimal value.
VPROCEDURE | 4 | A Procedure.
VFUNCTION | 5 | A Function.
VLABEL | 6 | A Label.

Operator Character Tokens

Operator tokens are token values returned by the Keyword/Token parser when an operator is encountered.  You should note, however, that some parsing functions will absorb certain operators.  For example:  string constants absorb the leading and trailing " and ' characters.

Table 9 - Operator Character Codes
CONSTANT | TOKEN | CHARACTER
NT_PLUS | 1 | +
NT_MINUS | 2 | -
NT_TIMES | 3 | *
NT_DIVIDE | 4 | /
NT_DBL_QUOTE | 5 | "
NT_SNG_QUOTE | 6 | '
NT_SEMICOLON | 7 | ;
NT_COLON | 8 | :
NT_LEFTBRACKET | 9 | [
NT_RIGHTBRACKET | 10 | ]
NT_LEFTBRACE | 11 | {
NT_RIGHTBRACE | 12 | }
NT_LEFTPAREN | 13 | (
NT_RIGHTPAREN | 14 | )
NT_EXCLAMATION | 15 | !
NT_AT | 16 | @
NT_POUND | 17 | #
NT_DOLLAR | 18 | $
NT_PERCENT | 19 | %
NT_CARET | 20 | ^
NT_AMPERSAND | 21 | &
NT_EQUAL | 22 | =
NT_LESSTHAN | 23 | <
NT_GREATERTHAN | 24 | >
NT_COMMA | 25 | ,

Exceptions
Introduction

When the Exceptions property is set to TRUE, the parser will respond to some errors by generating an exception. I have decided to make this optional since, at times, generating exceptions is undesireable.

Exception Types

All exceptions are decendants of Class(Exception).

EInvalidToken
Raised when an invalid token is encountered by the parser.

ENoKeywords
Raised when the Execute property is set to TRUE and there are no keywords defined in the keyword database.

ENoText
Raised when the Execute property is set to TRUE and there is no text in the Text property to parse.

EInvalidVariable
Raised when an attempt is made to define an invalid variable.

ENotExecuting
Raised when an attempt is made to call the NextToken method when the Execute property is set to FALSE.

EInvalidLine
Raised when an attempt is made to set the CurrentLine or CurrentIndex properties to invalid values.

Event Handler Reference

Event Types

TCancelEvent
Procedure( var Cancel: Boolean) of Object;

TErrorEvent
Procedure( ErrCode : Integer ) of Object;

TNewLineEvent
Procedure( LineNo : Integer; var Cancel : Boolean ) of Object;

TLineEvent
Procedure( LineNo : Integer ) of Object;

TNumExprEvent
Procedure( var Results : String; vType : Integer; 
  var Break : Boolean; var Cancel : Boolean ) of Object;

TStrExprEvent
Procedure( var Results : String; var Break : Boolean; 
  var Cancel : Boolean ) of Object;

TTraceEvent
Procedure( var Cancel : Boolean; var TraceState : TTraceState ) of Object;

Parsing Events

OnAlphaParse 
Declaration
Property OnAlphaParse : TCancelEvent;
Procedure( var Cancel: Boolean) of Object;

Description
Set Cancel to TRUE and exit the handler if you want to terminate execution of the script.
THIS EVENT IS TRIGGERED ONLY WHILE THE AlphaParse PROPERTY IS SET TO TRUE.

Once the Execute property has been set to TRUE, the parsing engine will parse the first token, then call this event.  If Cancel is not set to TRUE when this handler is exited, the parser will continue by parsing the next token.

Important Note:
This event is never triggered when NextParse, Evaluate, EvalString or EvalNumeric methods are called.
This is the main work horse event for the parser.  Generally it is a good idea to write the token handler in this routine. 

OnNextParse 
Declaration
Property OnNextParse : TCancelEvent;
Procedure( var Cancel: Boolean) of Object;

Description
Set Cancel to TRUE and exit the handler if you want to terminate execution of the script.

THIS EVENT IS TRIGGERED ONLY WHILE THE AlphaParse PROPERTY IS SET TO FALSE.

Once the Execute property has been set to TRUE, the parsing engine will parse the first token, then call this event.  If Cancel is not set to TRUE when this handler is exited, the parser will continue by parsing the next token.

Important Note:
This event is never triggered when NextParse, Evaluate, EvalString or EvalNumeric methods are called.
This is the main work horse event for the parser.  Generally it is a good idea to write the token handler in this routine.

OnProcedure (not yet implemented)
Declaration
Property OnProcedure : TCancelEvent;
Procedure( var Cancel: Boolean) of Object;

Description
Not implemented.

But when it is implemented, this event will be triggered when a variable (symbol) of type VPROCEDURE is encountered.

OnTrace 
Declaration
Property OnTrace : TTraceEvent
Procedure( var Cancel : Boolean; var TraceState : TTraceState ) of Object;

Description
If the DebugTrace property is set to TRUE DCossAPI will file this event on most core parsing states.  This will allow the programmer to examine what the parser is doing as a debugging aid. The TraceState parameter passed is defined as the following record structure:

TTraceState = Record
    Source        : String;
    Action        : String;
    CurrentLine   : Integer;
    CurrentIndex  : Integer;
    LineText      : String;
    Keyword       : String;
    Token         : Integer;
  end;

OnTypedVar 
Declaration
Property OnTypedVar : TCancelEvent;
Procedure( var Cancel: Boolean) of Object;

Description
Set Cancel to TRUE and exit the handler if you want to terminate execution of the script.

This event handler is triggered whenever a variable token is encountered.  It's main purpose is to simplify the evaluation of statements like Name = 'Greg'.

Important Note:
This event is called after the OnNextParse event is called.  If your program uses the OnTypedVar event, then ignore NT_VARIABLE_FOUND tokens in the OnNextParse event.  

Error Events

OnBadToken 
Declaration
Property OnBadToken : TCancelEvent;
Procedure( var Cancel: Boolean) of Object;

Description
This event is triggered after the OnNextParse event is triggered if the Token property contains an unrecognized token.  This event seems to me to be redundant and I may decide to remove it or change it's function in the future.

OnError 
Declaration
Property OnError : TErrorEvent;
Procedure( ErrCode : Integer ) of Object;

Description
This event is called whenever a reportable parsing engine error occurs.  The ErrCode argument contains an error code whose context is completely dependent on what caused the error.  This event was included to provide for automatic error logging.

Important Note:
If the Exceptions property is set to true, the parser will raise an exception before entering this event.  It is possible that the exception could cause the program to terminate before this event is called.

Text Events

OnEndOfLine 
Declaration
Property OnEndOfLine : TLineEvent;
Procedure( LineNo : Integer ) of Object;

Description
This event is called whenever an end of line is encountered.  May be used to display a progress message.  When this event occurs, the line is finished.

Important Note:
Not all end-of-lines will trigger this event.  Direct calls to some methods may parse past the end of a line without calling this event.

OnEndOfText 
Declaration
Property OnEndOfText : TLineEvent;
Procedure( LineNo : Integer ) of Object;

Description
This event is called when the end of text is encountered.  You can be sure of one thing ... when this event is called the script is done.

OnNewLine 
Declaration
Property OnNewLine : TNewLineEvent;
Procedure( LineNo : Integer; var Cancel : Boolean ) of Object;

Description
This event handler is called whenever the parser encounters a new line.  If you set the Cancel variable to TRUE, the parser will terminate execution of the script.

Expression Evaluation Events

OnEnterStrExpr 
Declaration
Property OnEnterStrExpr : TStrExprEvent;
Procedure( var Results : String; var Break : Boolean; 
  var Cancel : Boolean ) of Object;

Description
This event is called BEFORE the EvalString method begins evaluating the string.  There may be cases where you want to completely short-circuit the string evaluator with a custom one of your own.  If this is the case, remember to use the Break variable to cause the parser to break out of the EvalString method.  The following variables are passed to the event:

Table 10 - OnEnterStrExpr Passed Arguments
| TYPE | FUNCTION
Results | String | Store the results of your custom function as a string in this variable. The evaluator will include it.
Break | Boolean | If the custom function you are implementing is not expected to be used as an element of a complex expression (such as InputBox, etc.) then set this variable to TRUE after processing the function.  It instructs the parser that it should break the expression now.  Although this is not an error condition, it may cause an error for the user who tries to include this function in a complex expression.
Cancel | Boolean | If you have detected an error in the syntax, etc. of your custom function, then set this variable to TRUE to tell the parser to give up.

OnNumExprLoop (Formerly OnEnterNumExpr) 
Note: This event was originally improperly named OnEnterNumExpr.
Declaration
Property OnNumExprLoop : TNumExprEvent;
Procedure( var Results : String; vType : Integer; 
  var Break : Boolean; var Cancel : Boolean ) of Object;

Description
Whenever the EvalNumeric method is called and a registered numeric function token is encountered, the parser will trigger this event.  It's purpose is to allow the programmer the opportunity to evaluate special numeric functions. To help in that regard, the following parameters are passed to the event:

Table 11 - OnNumExprLoop Passed Arguments
| TYPE | FUNCTION
Results | String | Store the results of your custom function as a string in this variable. The evaluator will include it.
vType | Integer | The variable type expected - either VINTEGER or VFLOAT
Break | Boolean | If the custom function you are implementing is not expected to be used as an element of complex expression (such as InputBox, etc.) then set this variable to TRUE after processing the function.  It instructs the parser that it should break the expression now.  Although this is not an error condition, it may cause an error for the user who tries to include this function in a complex expression.
Cancel | Boolean | If you have detected an error in the syntax, etc. of your custom function, then set this variable to TRUE to tell the parser to give up.

See RegisterNumeric method.

OnStrExprLoop 
Declaration
Property OnStrExprLoop : TStrExprEvent;
Procedure( var Results : String; var Break : Boolean; 
  var Cancel : Boolean ) of Object;

Description
Whenever the EvalString method is called and a registered string function token is encountered, the parser will trigger this event.  It's purpose is to allow the programmer the opportunity to evaluate custom string functions. To help in that regard, the following variables are passed to the event:

Table 12 - OnStrExprLoop Passed Arguments
| TYPE | FUNCTION
Results | String | Store the results of your custom function as a string in this variable. The evaluator will include it.
Break | Boolean | If the custom function you are implementing is not expected to be used as an element of a complex expression (such as InputBox, etc.) then set this variable to TRUE after processing the function.  It instructs the parser that it should break the expression now.  Although this is not an error condition, it may cause an error for the user who tries to include this function in a complex expression.
Cancel | Boolean | If you have detected an error in the syntax, etc. of your custom function, then set this variable to TRUE to tell the parser to give up.

See RegisterFunction method.

Method Reference

Token/Keyword Parsing Methods

This is a collection of methods specific to Keyword and Token parsing.  Although TScriptParser performs token parsing automatically, it is best to expect the parser to detect the tokens for statement keywords, then write routines to parse the syntax of the statement.  The following set of methods are exported from BPOSSAPI.DLL's parsing engine.

GotoLocation
Syntax:
Procedure GotoLocation( Row, Col : Integer );

Description:
This procedure will 'GOTO' a new location in the script defined by the row (0-based line
number) and Col (character) positions.

IsKeyword
Syntax:
Function IsKeyword( kw : String ) : Boolean;

Description:
Returns TRUE if the current Keyword matches the keyword string passed in kw.

IsToken
Syntax:
Function IsToken( tkn : Integer ) : Boolean;

Description:
Returns TRUE if the current Token property matches the token passed in tkn.

LocateKeyword
Syntax
Function LocateKeyword( var LineNo, Index : Integer ) : Boolean;

Description
Returns TRUE if the current keyword was located on the current line.  This function returns the line number and the character index location of the keyword.

The purpose of this function is to help the programmer write code to locate the source of an error and highlight it on the user's screen.  I could also be used to back up the parser to the beginning of a statement.

LocateTextAt
Syntax
Function LocateTextAt( Line : Integer; Index : Integer ) : Word;

Description
Given a line number and a character index, this function will return the linear location of the character in the text.

NextToken
Syntax
Procedure NextToken;

Description
This procedure instructs the parsing engine to parse to the next token.  Token, Keyword, CurrentLine, CurrentIndex and associated properties are updated.

Note: This procedure will not trigger parsing events.

ParseWhileIn
Syntax
Function ParseWhileIn( const cset : Array of Integer ) : String;

Description
This function is used to parse the text while encountering tokens that match the set of tokens passed in the array cset.  It returns the complete text (white space included) until a token is found that is not contained in the set.

TextString := ParseWhileIn([NT_STRING_CONSTANT, NT_PLUS]);

The above example would parse the text containing string constants and '+' characters.  ParseWhileIn would return a null string if it encounters any other token.

PeekNextToken
Syntax
Function PeekNextToken( var tkn : Integer; var kw : String );

Description
This function returns in tkn and kw the next token and keyword encountered in the text.  No properties are effected by this call.

TokenInSetOf
Syntax
Function TokenInSetOf( tkn : Integer; const cset : Array of Integer ) : Boolean;

Description
Returns TRUE if the current Token property matches a token in the array cset.

Numeric and String Evaluation Methods

Evaluate
Syntax
Function Evaluate( expr : String; var Success : Integer ) : String;

Description
Evaluates the numeric expression in expr and returns the result as a string.  The Success variable will contain 0 if successful, otherwise an error code.

EvalNumeric
Syntax
Function EvalNumeric( var Results : String; vtype : Integer ) : Boolean;

Description
Starting with the current keyword and text location, this function will parse and evaluate a numeric expression.  The function will return TRUE if a numeric expression was found.  It will return FALSE if a numeric expression either was not encountered, or if an evaluation error occured.

Results will return a string containing the result of the expression, or the error description if unsuccessful.  vtype contains the type of expression (VINTEGER or VFLOAT).

EvalString
Syntax
Function EvalString( var Results : String ) : Boolean;

Description
Starting with the current keyword and text location, this function will parse and evaluate a string expression.  The function will return TRUE if a string expression was found.  It will return FALSE if a string expression either was not encountered, or if an evaluation error occured.

Results will return a string containing the result of the expression.

ExprType
Syntax
Function ExprType : Integer; Virtual;

Description
Starting with the current keyword and text location, this function will attempt to determine what type of expression follows.  The CurrentLine and CurrentIndex properties are not affected.

TestNumExpr
Syntax
Function TestNumExpr( left, op, right : String; var Success : Boolean ) : Boolean;

Description
This function returns true if the relational expression defined by <left> <op> <right> is true. This is a primitive function that may not meet the needs of some expressions.  See the TestRelation sample method in the TBasicInterpreter component source code for a better implementation.

Variable Related Methods

This set of methods relate to the definition and manipulation of variables.

AddVariable
Syntax
Function AddVariable( vname : String; vtype : Integer; vdata : String ) : Integer;

Description
Adds a new variable (or symbol) to the symbol table.  All data in the symbol table is handled as strings.  Pass the name of the variable in vname, the variable's data type in vtype, and a string representation of the data in vdata.  The variable type constants list is reprinted below.  Select the data type desired from the list and pass it in vtype.

i.e. AddVariable('TRUE', VINTEGER, '-1'); will create a variable called 'TRUE' and assign it (as a longint) the value -1.

Table 13 - AddVariable Constants
CONSTANT | VALUE | DESCRIPTION
VNONE | 0 | Undefined.
VSTRING | 1 | A 0..255 character string.
VINTEGER | 2 | A Long Integer value.
VFLOAT | 3 | An Extended decimal value.
VPROCEDURE | 4 | A Procedure.
VFUNCTION | 5 | A Function.
VLABEL | 6 | A Label.

GetVariable
Syntax
Function GetVariable( varname : String; var vartype : Integer ) : String;

Description
Returns the stored value of the variable (passed in varname) as a string. Returns the variable type in vartype if successful, otherwise returns -1.

PeekVariable
Syntax
Function PeekVariable( idx : Word; Var vtype : Integer ) : String;

Description
The symbol table database can be investigated with this function.  By passing an index value (0 to number of variables - 1) in idx PeekVariable will return the name of the variable stored in that symbol table record and return the variable type in vtype.

{ create a list of all known variables }

for idx := 0 to VariableCount-1 do begin
   vname := PeekVariable(idx, vtype);
   Text1.Add(vname + ' as type #' + IntToStr(vtype));
end;

SetVariable
Syntax
Function SetVariable( vname : String; vdata : String ) : Integer;

Description
Sets an existing variable's stored value.  Returns 0 if successful, otherwise returns the error code.  See AKW_* error code constants.

Note that it is important that the data passed in vdata is compatible with the data type of the variable.  It is a good idea to use GetVariable to determine it's type before attempting to set a variable.

VariableCount
Syntax
Function VariableCount : Integer;

Description
Returns the number of defined variables. A maximum of 32,767 variables can be defined.

Note: BPOSSAPI.DLL will only maintain up to 128 string variables.  Numeric variables are limited only by memory up to 32,767.

ZapVariable
Syntax
Procedure ZapVariable( varname : String );

Description
Removes the variable specified by varname from the variable database.

ZapVariables
Syntax
Procedure ZapVariables;

Description
Clears ALL variables from the symbol table.

It is very important to remember to ZapVariables (and, if required, add standard variables used in your interpreter) each time your program starts the interpreter.

ZapVariablesFrom
Syntax
Procedure ZapVariablesFrom( varname : String );

Description
Removes the variable specified by varname and all subsequently added variables from the variable database.

Keyword Definition Methods

KeyList.AddKey
Syntax
Function AddKey( kw : String; Fix : Boolean ) : Integer;

Description
Adds a new keyword to the KeyList property.  Up to 600 keywords can be defined. Returns the token assigned to this keyword.  Keywords are assigned tokens starting from 100 up to 799.  Token values from 100 to 4095 are reserved for future versions of TScriptParser.

The Fix parameter is currently ignored.  In an upcoming version of DCossAPI the Fix flag will be used to ‘fix’ keywords into the keyword database.  This will allow the programmer to ZapKeywords without zapping all of them.  Useful for handling run-time keyword generation.

AddKeyword
Syntax
Function AddKeyword( kw : String ) : Integer;

Description
Adds a new keyword to the keyword database.  Up to 256 keywords can be defined. Returns the token assigned to this keyword.  Keywords are assigned tokens starting from 100 up to 355.  Token values from 100 to 4095 are reserved for future versions of TScriptParser.

Important Note:

In general, it is a good idea to add your keywords to the KeyList TKeywordList property using the TScriptParser.KeyList.AddKey method before executing the script.  TScriptParser automatically defines any keywords located in the KeyList property when the Execute property is set to TRUE.

The AddKeyword function is provided to allow the programmer to implement a language that may need to define special tokens while the script is executing. These tokens can be used for just about anything.

Avoid using this function unless you need your program to define keywords while executing a script.

GetKeyword
Syntax
Function GetKeyword( idx : Integer ) : String;

Description
Returns a keyword from the keyword database record indexed by idx. As with PeekVariable, this function can be used to obtain a list of all defined keywords.

GetKeywordToken
Syntax
Function GetKeywordToken( kw : String ) : Integer;

Description
Returns the token assigned to the keyword passed in kw. If the keyword is not found, then -1 is returned.

GetTokenKeyword
Syntax
Function GetTokenKeyword( token : Integer ) : String;

Description
Returns the keyword string assigned to the token passed in tkn.  Returns a null string if the token is not assigned.

KeywordCount
Syntax
Function KeywordCount : Integer;

Description
Returns the number of keywords stored in the keyword database.

LoadKeywords
Syntax
Function LoadKeywords( Filename : String ) : Integer;

Description
Loads a previously saved file of keywords.  Returns DOS error level if unsuccessful.

The file must have been saved with SaveKeywords.

NT_CodeString
Syntax
Function NT_CodeString( token : Integer ) : String;

Description
A token related function used to return a context-class statement based on the value of the integer token provided.

Returns a context statement describing the class of token represented by the value of token.

This function is provided for the programmer for debugging purposes. It returns a short statement that describes the class of the token based on the NT_* result codes.

SaveKeywords
Syntax
Function SaveKeywords( Filename : String ) : Integer;

Description
Saves the current keyword database to the filename.  Returns 0 if successful or an error code if not.

ZapKeywords
Syntax
Procedure ZapKeywords;

Description
Clears ALL keyword definitions from the keyword database.

Special Utility Methods

DefTokenDelims
Syntax
Function DefTokenDelims : String;

Description
Returns a string containing all default tokens in the order they are defined.

NT_Operators
Syntax
Function NT_Operators : String;

Description
Returns a string containing all special operators in the order they are defined.

Label Methods

This section defines the methods used to maintain and use labels in the script.  It is not necessary for the programmer to use this method of line labeling, but it's easy.  Labels are defined as identifiers (up to 16 characters long) followed by a colon ':' character.  They are probably best implemented on a single line, but that is not necessary.

AddLabel
Syntax
Function AddLabel( lbname : String ) : Boolean;

Description
Add a new label to the symbol database.  The CurrentLine and CurrentIndex properties are used to determine the location of the label.  Labels are stored as type VLABEL.  They are stored as a long integer made up of 2 words.

Returns FALSE if the label can not be created.

GotoLabel
Syntax
Function GotoLabel( lbname : String ) : Boolean;

Description
Continues execution of the script (resets the parser) at the line and character index following the label passed in lbname.  Returns FALSE if the label does not exist.

ScanForLabels
Syntax
Procedure ScanForLabels;

Description
Scans the entire contents of TScriptParser.Text property for labels.  Any located labels are added to the symbol table.

It is important to remember to do this each time the script is executed.

i.e.:
ZapVariables;
ScanForLabels;

String and Numeric Function Registration Methods

This section covers the function registration methods.

Function registration methods define function tokens that should be processed by OnEnterStrExpr, OnStrExprLoop and OnEnterNumExpr events.  When a function is registered, it is placed in the expression evaluator's special function queue.  When a registered function's token is encountered, the expression evaluator will trigger the appropriate OnEnter* or OnLoop* event.  The programmer can then add the code in the event handler to evaluate and return the result to the parsing engine.

For an extensive example, see the TBasicInterpreter Component OnEnterStrExpr, OnStrExprLoop and OnEnterNumExpr events.

RegisterFunction
Syntax
Procedure RegisterFunction( tkn : Integer );

Description
Registers a token to be evaluated as a string expression.  The token passed in tkn must exist.

Remember, numeric expressions can, in some language implementations, be concidered as strings.  The sample component TBasicInterpreter does exactly that, in some cases.  By doing so, few or no type casting operators are required.

Tokens registered using this procedure will be passed to the OnEnterStrExpr or OnStrExprLoop event handler.

RegisterNumeric
Syntax
Procedure RegisterNumeric( tkn : Integer );

Description
Registers a token to be evaluated as a numeric expression.  The token passed in tkn must exist.

Tokens registered using this procedure will be passed on to the OnEnterNumExpr event handler.

Exported Generic Parsing Functions

This section covers the set of generic parsing functions exported by DCossAPI.  Functions whose names begin with ‘P’ use Pascal-friendly strings.  Those that begin with ‘C’ use Pchars. In all ‘C’ style functions the return string is in pBuf.  Use cbBuf to define the maximum size of the pBuf string.  Most also return the length of the string.

CGetWordAt/PGetWordAt
Syntax
Function PGetWordAt( idx : Integer; str, delims : String ) : String;
Function CGetWordAt( idx : Integer; str, delims : pChar; pBuf : PChar; cbBuf : Word ) : Integer;

Description
Locates the idx^th word in str based on delimiters specified in delims and returns the string. CGetWordAt returns the number of characters.

CLocateWord/PLocateWord
Syntax
Function PLocateWord( idx : Integer; str : String; delims : String ) : Integer;
Function CLocateWord( idx : Integer; str : pChar; delims : pChar ) : Integer;

Description
Locates the idx^th word in str based on delimiters specified in delims and returns it’s location.

CPackSpaces/PPackSpaces
Syntax
Function PPackSpaces( str : String ) : String;
Procedure CPackSpaces( str : PChar );

Description
Trims spaces from around and between words. ‘   Hello      There   ‘ becomes ‘Hello There’.

CParseStr/PParseStr
Syntax
Function PParseStr( var start : Integer; st, delims: String) : String;
Function CParseStr( var start : Integer; st: PChar; delims: PChar; pBuf: pChar; cbLen: Word ) : Integer;

Description
Parses the string st starting at character start using the delimiters specified by delims and returns the string.

CParseUntil/PParseUntil
Syntax
Function PParseUntil( Var start : Integer; st, cset: String) : String;
Function CParseUntil( Var start : Integer; st, cset: PChar; pBuf : pChar; cbBuf : Word ) : Word;

Description
Parses the string st starting at character start until one of the characters in cset is encountered and returns the string.

CWordCount/PWordCount
Syntax
Function PWordCount( st, delims : String ) : Integer;
Function  CWordCount( st : pChar; delims : pChar ) : Integer;

Description
Returns the count of words in string st based on the delimters found in delims.

Copyright Information

Your use of DCossAPI.DCU and/or BPossAPI.DLL indicates your acceptance of the following terms and conditions:

DCossAPI.DCU ("the Component") is a Windows/Delphi DCU licensed by Greg L. Truesdell ("GLT").

Shareware license.

You are free to distribute the entire unmodified contents of the distribution package to anyone you wish. You may NOT distribute any other programs that utilizes the Component without obtaining a Registered User License for the Component from GLT. For a period of no more than 30 days, you may use, test and duplicate the enclosed version of the Component.  Thereafter if you wish to continue using the Component you must register the Component with GLT, or else you must cease all use of the Component. You will be an infringer if you do not pay the registration fee and continue to use this version of the Component for more than 30 days.

Registered User License.

If you pay the registration fee for the Component to GLT, GLT will grant a non-exclusive development license for one natural person to use one copy of the software regardless if the owner of the license is a person or a business ("the Licensee"). In addition the Licensee may distribute the DCossAPI.DCU ("the DCU") with any or all products that use the DCU with the exceptions that (a) the recipients of any such program ("the Recipients") are not licensed to use the DCU or the Component except with the products produced by Licensees, and (b) the Recipients may not further redistribute the DCU, and (c) the product using the DCU cannot enable the user to produce other programs using the DCU or other parts of the supplied distribution package.  No purported transfer of the license shall be effective until the licensee notifies GLT of the name and address of the person receiving the license ("the Transferee"), and transfers all copies of the Component to the Transferee, and removes or destroys any other copies of the Component in the possession of, or under the control of the Licensee.

Disclaimer of Warranties.

GLT makes no claims as to the suitability of the Component for any specific purpose.  GLT DISCLAIMS ANY AND ALL WARRANTIES EXPRESS OR IMPLIED, WRITTEN OR ORAL, INCLUDING ANY WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY SPECIFIC PURPOSE. The 30 day evaluation period is considered liberal enough for you to determine the fitness of this product to your application.

Limitation of Liability.

In no event shall GLT be liable for any damages whatsoever arising out of the use of the Component, including without limitation any direct, indirect or consequential damages or any damages for business interruption, loss of profits, loss of information, or any pecuniary loss even if GLT has been notified of the possibility of such damages. The limitation or exclusion of liability for incidental or consequential damages may not be allowed in some states, and in these states those particular prohibited limitations do not apply.

Copyright Information

The Component is protected by the copyright laws of Canada and the United States, and by the copyright laws of many other countries pursuant to international treaties. The DCU and all other materials provided in the distribution package are Copyright (c) 1995 by Greg Truesdell.  All Rights reserved. No portion of the Component, documentation or examples may be copied, stored, or transmitted except as provided by the license.

Other brand and product names are trademarks or registered trademarks of their respective holders.
Index

A
AddKeyword, 30
AddLabel, 34
AddVariable, 28
AKW_DUPLICATE_KEYWORD, 14
AKW_INVALID_CHAR, 14
AKW_INVALID_TOKEN, 14
AKW_KEYWORD_TOO_LONG, 14
AKW_NO_MORE_ROOM, 14
AKW_OVERFLOW, 14
AKW_TYPE_MISMATCH, 14
AsFloat, 11
AsInteger, 11
AsString, 11
AsVarType, 11
B
BPOSSAPI.DLL, 25, 29
C
Copyright Information, 38
CurrentIndex, 10, 17, 26, 34
CurrentLine, 10, 17, 26, 34
D
DCOSSAPI, 6
DefTokenDelims, 33
E
EInvalidToken, 17
EInvalidVariable, 17
ENoKeywords, 17
ENotExecuting, 17
ENoText, 17
EvalNumeric, 19, 23, 27
EvalString, 19, 23, 24, 27
Evaluate, 19, 27
Events, 11
Exceptions, 10, 21
Execute, 10, 17, 19
EXPR_COMMA_MISSING, 15
EXPR_EXPECTED_EXPRESSION, 15
EXPR_EXPECTED_FACTOR, 15
EXPR_EXPECTED_TERM, 15
EXPR_EXTERNAL_CALL, 15
EXPR_GARBAGE_FOLLOWS, 15
EXPR_INVALID_IDENTIFIER, 15
EXPR_INVALID_PARAMETER, 15
EXPR_INVALID_VAR_OR_FUNC, 15
EXPR_MISSING_RPAREN, 15
EXPR_OUT_OF_MEMORY, 15
EXPR_OVERFLOW, 15
EXPR_PARAMETER_COUNT_ERROR, 15
EXPR_PARAMETER_MISSING, 15
EXPR_PARAMETERS_NOT_ALLOWED, 15
EXPR_SYNTAX_ERROR, 15
EXPR_TYPE_MISMATCH, 15
EXPR_VARIABLE_EQUATE_ERROR, 15
EXPR_ZERO_DIVIDE, 15
G
GetKeyword, 30
GetKeywordToken, 30
GetTokenKeyword, 31
GetVariable, 28, 29
GotoLabel, 34
I
IsKeyword, 25
IsToken, 25
K
KeyWord, 10, 25, 26
KeywordCount, 32
Keywords, 30
L
LineText, 11
LoadKeywords, 32
LocateKeyword, 25
LocateTextAt, 25
M
MAX_KEYWORD_LEN, 14
MAX_KEYWORDS, 14
Methods, 13
N
Name, 10
NextParse, 19
NextToken, 17, 26
NT_AMPERSAND, 16
NT_AT, 16
NT_CARET, 16
NT_CodeString, 32
NT_COLON, 16
NT_COMMA, 16
NT_DBL_QUOTE, 16
NT_DIVIDE, 16
NT_DOLLAR, 16
NT_EQUAL, 16
NT_EXCLAMATION, 16
NT_FUNCTION, 15
NT_GREATERTHAN, 16
NT_LABEL_FOUND, 15
NT_LEFTBRACE, 16
NT_LEFTBRACKET, 16
NT_LEFTPAREN, 16
NT_LESSTHAN, 16
NT_MATH_FUNCTION, 15
NT_MINUS, 16
NT_NO_FREE_MEMORY, 15
NT_NO_KEYWORDS, 15
NT_NUMERIC_CONSTANT, 15
NT_Operators, 33
NT_PAST_EOF, 15
NT_PERCENT, 16
NT_PLUS, 16
NT_POUND, 16
NT_PROCEDURE, 15
NT_RIGHTBRACE, 16
NT_RIGHTBRACKET, 16
NT_RIGHTPAREN, 16
NT_SEMICOLON, 16
NT_SNG_QUOTE, 16
NT_STRING_CONSTANT, 15
NT_TIMES, 16
NT_TOKEN_NOTFOUND, 15
NT_VARIABLE_FOUND, 15, 20
O
OnAlphaParse, 19
OnBadToken, 12, 21
OnEndOfLine, 12, 22
OnEndOfText, 12, 22
OnEnterNumExpr, 12, 23, 35
OnEnterStrExpr, 12, 23, 35
OnError, 12, 21
OnLoopStrExpr, 35
OnNewLine, 12, 22
OnNextParse, 12, 19, 20
OnProcedure, 12, 20
OnStrExprLoop, 12, 20, 24
OnTypedVar, 12, 20
Options|Install Components, 8
P
ParseWhileIn, 26
PeekNextToken, 26
PeekVariable, 28
PKUNZIP, 8
Properties, 9
R
RegisterFunction, 12, 24, 35
RegisterNumeric, 12, 24, 35, 36, 37
S
SaveKeywords, 32
ScanForLabels, 34
SetVariable, 29
T
Tag, 10
TCancelEvent, 18, 19, 20, 21
TErrorEvent, 18, 21
TestNumExpr, 27
TestRelation, 27
Text, 10, 17, 34
TLineEvent, 18, 22
TNewLineEvent, 18, 22
TNumExprEvent, 18, 23
Token, 10, 25, 26
TokenInSetOf, 26
TScrDemo, 27
TScriptParser, 25, 30
TStrExprEvent, 18, 20, 23, 24
TString.Add, 30
V
VariableCount, 29
VBOSSAPI, 6
VFLOAT, 16, 23, 27, 28
VFUNCTION, 16, 28
VINTEGER, 16, 23, 27, 28
VLABEL, 16, 28, 34
VNONE, 16, 28
VPROCEDURE, 16, 28
VSTRING, 16, 28
Z
ZapKeywords, 32
ZapVariables, 29, 34