📄 yytools.~pas
字号:
unit yytools;
//1999.9.17.
interface
uses Sysutils, Classes, buttons, Forms, Dialogs;
// StdCtrls, ComCtrls, Buttons, Mask, ToolEdit, CurrEdit,Db, DBTables;
const
gnOK = 0;
gnNotOK = 1;
function InitYoYo: integer;
function ysCloseApp: integer;
function ysCopyFile(s: string): integer;
procedure RewriteLog; //建立日志文件
procedure AppendLog(s:string);//写日志文件
type
TYYSource = array[1..20] of string;
TYYBtn = record
YYSource: TYYSource;
YYSourceLine: integer;
end;
var
gsList: TStrings;
gsYYlist: TStrings;
gBut: TBitBtn;
ButPath, ButBMPPath: string;
gsButCaption: string;
gsButBMPFile: string;
gsButHint: string;
gnButTab:integer;
gnButTabOrder:integer;
gnPanX, gnPanY, gnPanXOff, gnPanYOff: integer;
gnYYCount: integer;
gnYYCurrent: integer;
gaYYBtn: array[1..20] of TYYBtn; //存放读入的yy语言代码
gnYPoint: integer; //记录脚本语言当前执行到第几行
gnResult: integer; //记录函数返回值
gsLogFile:string;//日志文件文件名
gnBottomID:integer;//记录数据库最后的ID
gnCurrID:integer; //当前数据库指针
gnErr:integer;//出错代码
implementation
uses Tools, JBStr;
//1999.9.17. 9.23.
function InitYoYo: integer;
begin
ButPath := GetAppPath + 'Buttons\';
ButBMPPath := GetAppPAth + 'ButtonsBMP\';
gnPanXOff := 4;
gnPanYOff := 8;
gsLogFile:='log.txt';
ReWriteLog;//建立日志文件
end;
//1999.9.17.
//y-system 结束程序
function ysCloseApp: integer;
begin
Application.Terminate;
gnResult := gnOK;
end;
//1999.9.21.
//复制文件
function ysCopyFile(s: string): integer;
var
s1, s2: string;
begin
try
s1 := ExtractWord(2, s, [' ']);
s2 := ExtractWord(3, s, [' ']);
CopyFile(GetAppPath + s1, GetAppPath + s2);
gnResult := gnOK;
except
gnResult := gnNotOK;
end;
end;
//1999.9.23.
//建立日志文件
procedure RewriteLog;
var
f:text;
begin
AssignFile(f,GetAppPath+gsLogFile);
ReWrite(f);
Writeln(f,'文件建立');
CloseFile(f);
end;
//1999.9.23.
//写日志文件
procedure AppendLog(s:string);
var
f:text;
begin
AssignFile(f,GetAppPath+gsLogFile);
Append(f);
WriteLn(f,s);
CloseFile(f);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -