?? cajscript.html
字號(hào):
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="Author" content="Carlo">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>CajScript 2.0</title>
</head>
<body bgcolor="#C0C0FF" text="#000000" link="#0000FF"
vlink="#800080" alink="#FF0080">
<h1>Cajscript 2.0</h1>
<p>Made by <a href="http://www.weyert.nl/innerfuse">InnerFuse</a>.</p>
<p><a name="tcs2pascalscript"></a><tt>TCs2PascalScript = </tt><b><tt>Object/Class</tt></b><br>
<tt>Variables : </tt><a href="#pvariablemanager"><tt>PVariableManager</tt></a><tt>
</tt><b><tt>read</tt></b><tt> Use to add variables.</tt><br>
<tt>Procedures : </tt><a href="#pproceduremanager"><tt>PProcedureManager</tt></a><b><tt>
read</tt></b><tt> Use to add external function/procedures.</tt><br>
<tt>OnUses : </tt><a href="#tonuses"><tt>TOnUses</tt></a><tt> </tt><b><tt>Read/Write</tt></b><tt>
Triggered when an Uses Clause is occured.</tt><font
face="Times New Roman"><br>
</font><tt>OnRunLine : </tt><a href="#tonrunline"><tt>TOnRunLine</tt></a><tt>
</tt><b><tt>Read/Write</tt></b><tt> Triggered when an Uses Clause
is occured.</tt><font face="Times New Roman"><br>
</font><tt>ErrorCode : </tt><a href="#tcs2error"><tt>TCs2Error</tt></a><tt>
</tt><b><tt>Read</tt></b><tt> Used to read the error occured.</tt><br>
<tt>ErrorPos : LongInt </tt><b><tt>Read</tt></b><tt> Used to read
the error position.</tt></p>
<p><b><tt>Constructor </tt></b><tt>Create (Id : Pointer);</tt><br>
<tt>Create an instance of the script engine, ID is passed to all
events.</tt></p>
<p><b><tt>Procedure </tt></b><tt>SetText (p : Pchar);</tt><br>
<tt>Assign a text to the script engine. Afterwards you should
check</tt><i><tt>errorcode</tt></i><tt>.</tt></p>
<p><b><tt>Procedure </tt></b><tt>RunScript;</tt><br>
<tt>Execute the script code, first assign some script with </tt><i><tt>SetText</tt></i><tt>.</tt></p>
<p><b><tt>Function </tt></b><tt>RunScriptProc (</tt><b><tt>Const </tt></b><tt>Name
: </tt><b><tt>String</tt></b><tt>;Parameters : </tt><a
href="#pvariablemanager"><tt>PVariableManager</tt></a><tt>): </tt><a
href="#pcajvariant"><tt>PCajVariant</tt></a><tt>;</tt><br>
<tt>Run an function inside the script. Parameters must be
assigned. If there are any parameter errors it will return :
EParameterError. Error position points the the param no. If the
function does not exist, it returns EUnknownIdentifier with
position 0.</tt></p>
<p><b><tt>Destructor </tt></b><tt>Destroy;</tt><br>
<tt>Destroy the scriptengine.</tt></p>
<hr>
<p><br>
<a name="pvariablemanager"></a><b>PVariableManager</b><br>
<b>Type</b><br>
PVariableManager = Pointer;<br>
Variable manager is used for storing an array of variables. You
can use these functions for accessing it:</p>
<p><b>Function </b>VM_Create (InheritFrom : PVariableManager) :
PVariableManager;<br>
Create an instance of PVariableManager<br>
<b>Procedure</b> VM_Destroy (p : PVariableManager);<br>
Destroy an instance of PVariableManager<br>
<b>Function </b>VM_Add ( P : PVariableManager; D : <a
href="#pcajvariant">PCajVariant</a>;<b>Const </b>Name : <b>String</b>)
: <a href="#pcajvariant">PCajVariant</a>;<br>
Add a PCajVariant to it.<br>
<b>Procedure </b>VM_Delete (p : PVariableManager; Idx : LongInt);<br>
Delete a PCajVariant from it. Also destroy all the Variants.<br>
<b>Function </b>VM_Get (p : PVariableManager; Idx : LongInt) : <a
href="#pcajvariant">PCajVariant</a>;<br>
Return a PCajVariant from the variable list.<br>
<b>Procedure</b> VM_SetName (p : PVariableManager; Idx : LongInt;
S: <b>String</b>);<br>
Set the name of an item.<br>
<b>Function </b>VM_Count (p : PVariableManager) : LongInt;<br>
Return the number of variant.<br>
<b>Function </b>VM_Find (p : PVariableManager; <b>Const </b>Name
:<b>String</b>) : LongInt;<br>
Find a variant.<br>
<b>Procedure </b>VM_Clear (p : PVariableManager);<br>
Remove all items from the list.</p>
<hr>
<p><br>
<a name="pproceduremanager"></a><b>PProcedureManager</b><br>
<b>Type </b>PProcedureManager = Pointer.<br>
Procedure manager is used for adding external procedures to the
script.</p>
<p><b>Function </b>PM_Create : PProcedureManager;<br>
Create an instance of PProcedureManager.<br>
<b>Procedure </b>PM_Destroy (p : PProcedureManager);<br>
Destroy an instance of PProcedureManager.<br>
<b>Procedure </b>PM_Clear (p : PProcedureManager);<br>
Remove all items.<br>
<b>Procedure </b>PM_Add (p : PProcedureManager; Const Spec : <b>String</b>;Addr
: Pointer);<br>
Spec should be the procedure header in this format:<br>
<tt>ReturnType+' '+ProcedureName+' '+Parameter1Name+'
'+Parameter1Type+' '+Parameter2Name....</tt><br>
The types are number (see PCajVariant0.<br>
When there is an ! before the parameter name, it is an <b>Var</b>
variant.This can be changed.</p>
<p>Addr should point to an <a href="#tregisteredproc">TRegisteredProc.</a><br>
<b>Procedure</b> PM_Delete (p : PProcedureManager; I : LongInt);<br>
Delete procedure number I.<br>
<b>Function</b> PM_Find (p : PProcedureManager; Const Name : <b>String</b>):
Integer;<br>
Search for procedure.<br>
<b>Function</b> PM_Get (p : PProcedureManager; i : LongInt) :
Pointer;<br>
Return the address of the procedure.<br>
<b>Function</b> PM_GetSpec (p : PProcedureManager; i : LongInt) :
<b>String</b>;<br>
Return the procedure definition of I.<br>
</p>
<hr>
<p><br>
<a name="tcs2error"></a><b>Type </b>TCs2Error = Word;<br>
TCs2Error is used for error handling.</p>
<p>Eror codes:<br>
ENoError - No error has occured<br>
ECanNotReadProperty - Can not read property, not used yet<br>
ECanNotWriteProperty - Can not write property, not used
yet<br>
EUnknownIdentifier - The identifier is unknown<br>
EIdentifierExpected - An identifier is expected<br>
ESemicolonExpected - A semicolon is required<br>
EBeginExpected - <em>Begin </em>is expected<br>
EDuplicateIdentifier - Duplicate identifier<br>
EUnexpectedEndOfFile - Unexpected end of file is occured<br>
EColonExpected - An colon is expected<br>
ESyntaxError - There was an error in the syntax<br>
EStringError - A string error, usually, a string that has
notended before the enter.<br>
EErrorInStatement - Error in the statement<br>
EAssignmentExpected - Assignment is expected<br>
ETypeMismatch - Type is not the same.<br>
EErrorInExpression - Error in the expresssion.<br>
ERoundOpenExpected - A round open is expected<br>
ERoundCloseExpected - A round close is expected<br>
EVariableExpected - A variable is expected<br>
ECommaExpected - A comma is expected<br>
EThenExpected - <i>Then</i> is expected<br>
EPeriodExpected - A period is expected<br>
EParameterError - Parameter error, occurs when calling
RunScriptProc.The ErrorPos gives the parameter number.<br>
EToExpected - <em>To </em>expected<br>
EDoExpected - <em>Do</em> expected<br>
ERangeError - out of range<br>
EOfExpected - <em>Of</em> expected<br>
EndExpxcted - <em>End</em> expected<br>
EOutOfRange - Out of range<br>
EOpenBlockExpected - Open block expected<br>
ECloseBlockExpected - Close block expected<br>
</p>
<hr>
<p><a name="tonuses"></a><tt>TOnUses =</tt><b><tt>Function </tt></b><tt>(</tt><br>
<tt> Id
: Pointer;</tt><br>
<tt> Sender
: PCs2PascalScript;</tt><br>
<tt> Name
: </tt><b><tt>String</tt></b><br>
<tt> )
: TCs2Error;</tt><br>
<tt>This function is triggered when script is loaded (When
assigning a script it is </tt><em><tt>SYSTEM</tt></em><i><tt>) </tt></i><tt>and
when someone add uses XXX; One uses can not occur twice.</tt></p>
<p><i><tt>Id</tt></i><tt> The id passed to the </tt><b><tt>TCs2PascalScript.Create</tt></b><tt>.
Can be used when using more scripts at once.</tt><br>
<i><tt>Sender</tt></i><tt> The </tt><b><tt>TCs2PascalScript</tt></b><tt>.</tt><br>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -