delphi脚本语言(50分)

  • 主题发起人 jxpengfei
  • 开始时间
J

jxpengfei

Unregistered / Unconfirmed
GUEST, unregistred user!
我各们同仁你好,不知谁有对delphi脚本语言很清的,请大家发言
 
真不知道你说的是那种脚本,写cgi的时候有脚本,编译的时候有Make脚本...等。
你说的是哪一种啊?老兄!
 
也不知道是sm!
 
说的清楚些!
 
兄第们:
delphi/Pascal脚本解析器
 
TUDIPascalEngine v0.99 Pascal脚本解析器语法规范
--------------------------------------------------------------------------------
(C)CopyRight 1998-2001 @Pyseries(潘毅), All Rights Reserved.
兰州石油机械研究所 LanZhou.GanSu.China 邮编: 730050
(0931)2337551 13088766570 Panyi_cn@sina.com Panyi_cn@Sohu.com
--------------------------------------------------------------------------------
数据类型:
Type Range Notes
------------------------------------------------------------
Byte 0~255 Unsigned 8-bit
ShortInt -128~127 Signed 8-bit
Word 0~65535 Unsigned 16-bit
Integer -2147483648~2147483647 Signed 32-bit
Longint 0~4294967295 Unsigned 32-bit
Cardinal 0~4294967295 Unsigned 32-bit
Char 8-Bit
String 255Characters 2~256 bytes
Real 5.0x10^-324~1.7x10^308 15~16有效位 8Bytes
Single 1.5x10^-45~3.4x10^38 7~8有效位 4Bytes
do
uble 5.0x10^-324~1.7x10^308 15~16有效位 8Bytes
Extended 3.6x10^-4951~1.1x10^4932 19~20有效位 10Bytes
Comp -2^63+1~2^63-1 19~20有效位 8Bytes
Boolean True/False
Array 数组(仅支持一维数组)
File 文件句柄类型
〖注〗:日期时间以实数表示。
表达式运算法则:
运算符 优先次序
函数 0
(,) 1
-,+,Not 2 (注: 对首项。如:Not (x>0) )
*,/,Div,Mod 3
+,-,And,Or 4
=, <>, <, >, <=, >= 5
标准函数库清单:
三角函数
№00 Function ArcCos(Const x: Extended): Extended; // 反余弦函数(弧度单位)
№01 Function ArcCosh(Const x: Extended): Extended; // 反双余弦函数(弧度单位)
№02 Function ArcSin(Const x: Extended): Extended; // 反正弦函数(弧度单位)
№03 Function ArcSinh(Const x: Extended): Extended; // 反双正弦函数(弧度单位)
№04 Function ArcTan(Const x: Extended): Extended; // 反正切函数(弧度单位)
№05 Function ArcTanh(Const x: Extended): Extended; // 反双正切函数(弧度单位)
№06 Function Cos(Const x: Extended): Extended; // 余弦函数(弧度单位)
№07 Function Cosh(Const x: Extended): Extended; // 双余弦函数(弧度单位)
№08 Function Sin(Const x: Extended): Extended; // 正弦函数(弧度单位)
№09 Function Sinh(Const x: Extended): Extended; // 双正弦函数(弧度单位)
№10 Function Tan(Const x: Extended): Extended; // 正切函数(弧度单位)
№11 Function Tanh(Const x: Extended): Extended; // 双正切函数(弧度单位)
数学函数
№00 Function Abs(Const x: Extended): Extended; // 绝对值函数
№01 Function Ceil(Const x: Extended): Longint; // 正方向取整:Ceil(2.8)=3 Ceil(-2.8)=2 Ceil(-1.0)=-1
№02 Function Exp(Const x: Extended): Extended; // 自然指数函数(2**x)
№03 Function Floor(Const x: Extended): Longint; // 负方向取整:Floor(2.8)=2 Floor(-2.8)=3 Floor(-1.0)=-1
№04 Function Frac(Const x: Extended): Extended; // 返回参数的小数部分
№05 Function Int(Const x: Extended): Extended; // 返回参数的整数部分
№06 Function IntPower(Const x: Extended;
Const n: Longint): Extended; // 计算X**n
№07 Function Ln(Const x: Extended): Extended; // 自然对数函数
№08 Function Log10(Const x: Extended): Extended; // 计算Log10(x)
№09 Function Log2(Const x: Extended): Extended; // 计算Log2(x)
№10 Function LogN(Const Base: Extended;
Const X: Extended): Extended; // 计算LogN(x),基数为Base
№11 Function Max(Const A: Extended;
Const B: Extended): Extended; // 取最大值
№12 Function Min(Const A: Extended;
Const B: Extended): Extended; // 取最小值
№13 Function Pi: Extended; // 返回圆周率=3.1415926535897932385
№14 Function Power(Const x: Extended;
Const y: Extended): Extended; // 计算X**Y
№15 Function Round(Const x: Extended): Longint; // 将实数值四舍五入为整型值
№16 Function Sign(Const x: Extended): Longint; // 返回数据的正负符号值:-1,0,1
№17 Function Sqr(Const x: Extended): Extended; // 平方函数
№18 Function Sqrt(Const x: Extended): Extended; // 平方根函数
№19 Function Trunc(Const x: Extended): Longint; // 将实型值去掉小数值截取为整型值
№20 Procedure Randomize; // 初始化随机数
№21 Function Random: Extended; // 生成随机数
№22 Procedure Inc(Var x: Extended); // 递增:x=x+1
№23 Procedure Dec(Var x: Extended); // 递减:x=x-1
字符串函数
№00 Function CompareStr(Const S1: String;
Const S2: String): Longint; // 比较字符串(区分大小写)
№01 Function CompareText(Const S1: String;
Const S2: String): Longint; // 比较字符串(不区分大小写)
№02 Function Copy(Const S: String;
Const Index: Longint;
Const Count: Longint): String; // 返回一字符串的子串:Copy('abcd',2,2)='bc'
№03 Procedure Delete(Var S: String;
Const Index: Longint;
Const Count: Longint); // 从字符串中删除子串
№04 Procedure Insert(Const Source: String;
Var S: String;
Const Index: Longint); // 在字符串中插入子串
№05 Function Length(Const S: String): Longint; // 返回字符串的动态长度
№06 Function LowerCase(Const S: String): String; // 将给定的字符串变为小写
№07 Function Pos(Const Substr: String;
Const S: String): Longint; // 在字符串中搜索子串
№08 Function SameText(Const S1: String;
Const S2: String): Boolean; // 比较字符串是否一致(不区分大小写)
№09 Function StringOfChar(Const Ch: Char;
Const Count: Longint): String; // 以指定字符构造字符串
№10 Function Trim(Const S: String): String; // 从给定的字符串中删除前导和尾部的空格及控制字符
№11 Function TrimLeft(Const S: String): String; // 从给定的字符串中删除首部的空格及控制字符
№12 Function TrimRight(Const S: String): String; // 从给定的字符串中删除尾部的空格及控制字符
№13 Function UpperCase(Const S: String): String; // 将给定的字符串变为大写
№14 Function IsFloat(Const S: String): Boolean; // 给定的字符串是否是实数
№15 Function IsInteger(Const S: String): Boolean; // 给定的字符串是否是整数
№16 Function Identifier: String; // 十六位不重复标识符
№17 Function BigCurrencyFmt(Const x: Extended): String; // 将实数转换成大写格式金额
№18 Function SmallCurrencyFmt(Const x: Extended): String; // 将实数转换成小写格式金额
№19 Function FormatFloat(Const FmtStr: String;
Const x: Extended): String; // 格式化实数
№20 Function FormatStr(Const FmtStr: String;
Const S: String): String; // 格式化字符串
№21 Function GetToken(Var S: String;
Const Delim: String): String; // 截取字符串
类型转换函数
№00 Function BinToHex(Const B: String): String; // 二进制转换成十六进制
№01 Function BoolToStr(Const B: Boolean): String; // 逻辑类型数据转换成字符串
№02 Function HexToBin(Const H: String): String; // 十六进制转换成二进制
№03 Function StrToBool(Const S: String): Boolean; // 字符串转换成逻辑类型数据
№04 Function StrToInt(Const S: String): Longint; // 字符串转换成整型数据
№05 Function IntToStr(Const N: Longint): String; // 整型数据转换成字符串
№06 Function IntToHex(Const N: Longint;
Const m: Longint): String; // 整型数据转换成十六进制数据
№07 Function FloatToStr(Const X: Extended): String; // 浮点数据转换字符串
№08 Function StrToFloat(Const S: String): Extended; // 字符串转换浮点数据
№09 Function Ord(Const C: Char): Byte; // 返回指定字符的ASCII值
№10 Function Chr(Const N: Byte): String; // 返回指定ASCII值的字符
日期与时间函数
№00 Function Date: Extended; // 返回当天日期
№01 Function Time: Extended; // 返回现在时间
№02 Function Now: Extended; // 返回现在的日期时间
№03 Function DateTimeToStr(Const x: Extended): String; // 将日期时间格式转为字符串
№04 Function DateToStr(Const x: Extended): String; // 将日期格式转为字符串
№05 Function TimeToStr(Const x: Extended): String; // 将时间格式转为字符串
№06 Function DayOfWeek(Const x: Extended): Longint; // 返回今天星期几
№07 Procedure DecodeDate(Const Date: Extended;
Var YY: Word;
Var MM: Word;
Var DD: Word); // 分解所指定的日期为年、月、日
№08 Procedure DecodeTime(Const Time: Extended;
Var hh: Word;
Var mm: Word;
Var ss: Word;
Var ms: Word); // 分解所指定的时间为时、分、秒
№09 Function EncodeDate(Const YY: Word;
Const MM: Word;
Const DD: Word): String; // 返回年月日所组合的日期值
№10 Function EncodeTime(Const hh: Word;
Const mm: Word;
Const ss: Word;
Const ms: Word): String; // 返回时分秒所组合的时间值
№11 Function StrToDate(Const S: String): Extended; // 将字符串转为日期数据
№12 Function StrToDateTime(Const S: String): Extended; // 将字符串转为日期时间数据
№13 Function StrToTime(Const S: String): Extended; // 将字符串转为时间数据
文件I/O函数
№00 Function FileExists(Const S: String): Boolean; // 判断文件是否存在
№01 Function DirectoryExists(Const S: String): Boolean; // 判断目录是否存在
№02 Function CreateDir(Const S: String): Boolean; // 创建目录
№03 Function DeleteFile(Const S: String): Boolean; // 删除文件
№04 Function RemoveDir(Const S: String): Boolean; // 删除目录
№05 Function FileIsReadOnly(Const S: String): Boolean; // 文件是否是只读
№06 Function RenameFile(Const OldName: String;
Const NewName: String): Boolean; // 修改文件名
№07 Procedure FOpen(Var F: File;
Const FileName: String;
Const Mode: Word); // 打开文件
№08 Procedure FClose(Var F: File); // 关闭文件
№09 Procedure FReadLn(F: File;
Var S: String); // 从文件中读一行字符串
№10 Procedure FWriteLn(F: File;
Const S: String); // 从文件中写一行字符串
№11 Procedure FRead(F: File;
Var S: String;
Var Len: Integer); // 从文件中读字符串
№12 Procedure FWrite(F: File;
Const S: String;
Var Len: Integer); // 从文件中写字符串
№13 Function FSize(F: File): Longint; // 文件大小
№14 Function FPos(F: File): Longint; // 文件读写位置
№15 Function FSeek(F: File;
Const Pos: Longint): Boolean; // 设置文件读写位置
№16 Function FBof(F: File): Boolean; // 是否在文件起始位置
№17 Function FEof(F: File): Boolean; // 是否在文件末尾位置
杂类函数
№00 Function DiskFree(Const Drive: Longint): Longint; // 逻辑盘剩余空间
№01 Function DiskSize(Const Drive: Longint): Longint; // 逻辑盘空间
№02 Procedure ShowMessage(Const S: String); // 提示信息窗口
№03 Function MessageBox(Const Msg: String;
Const DlgType: Longint;
Const Buttons: Longint): Longint; // 显示信息窗口
№04 Function InputBox(Const ACaption: String;
Const APrompt: String;
Const ADefault: String): String; // 输入信息窗口
№05 Function MessageBeep(Const uType: Longint): Boolean; // 播放系统波形声音
№06 Procedure Beep; // 产生一个警告声
常数
№00 True: Boolean; // 逻辑“真”
№01 False: Boolean; // 逻辑“假”
№02 mbYes: Longint; // 按钮“Yes”
№03 mbNo: Longint; // 按钮“No”
№04 mbOk: Longint; // 按钮“Ok”
№05 mbCancel: Longint; // 按钮“Cancel”
№06 fmCreate: Longint; // 文件“创建”操作
№07 fmOpenRead: Longint; // 文件“只读”操作
№08 fmOpenWrite: Longint; // 文件“只写”操作
№09 fmOpenReadWrite: Longint; // 文件“读写”操作
№10 fmShareCompat: Longint; // 文件“共享”属性
№11 fmShareExclusive: Longint; // 文件“共享”属性
№12 fmShareDenyWrite: Longint; // 文件“共享”属性
№13 fmShareDenyRead: Longint; // 文件“共享”属性
№14 fmShareDenyNone: Longint; // 文件“共享”属性
№15 clAqua: Longint; // 颜色Aqua
№16 clBlack: Longint; // 颜色Black
№17 clBlue: Longint; // 颜色Blue
№18 clGray: Longint; // 颜色Gray
№19 clGreen: Longint; // 颜色Green
№20 clLime: Longint; // 颜色Lime
№21 clNavy: Longint; // 颜色Navy
№22 clOlive: Longint; // 颜色Olive
№23 clPurple: Longint; // 颜色Purple
№24 clRed: Longint; // 颜色Red
№25 clSilver: Longint; // 颜色Silver
№26 clTeal: Longint; // 颜色Teal
№27 clWhite: Longint; // 颜色White
№28 clYellow: Longint; // 颜色Yellow
 
to jxpengfei 只能函数调用的脚本吗?没有看到逻辑表达式、文件包含等
我觉得如果想用Pascal 语言风格的脚本的话:Innerfuse Pascal Script 是最好的,功能比较强大,
而且扩充起来也很方便。
 
http://www.playicq.com/dispdoc.php?t=&id=306
 
http://www.playicq.com/dispdoc.php?t=33&id=1993
这里有一个Pascal解释器
 
接受答案了.
 
顶部