🎨 style(markdown): format all markdown files with prettier

- 使用 prettier 格式化所有 markdown 文件
- prose-wrap: always, print-width: 80
- 保持代码块和表格格式
- 提升可读性和一致性

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
csh
2026-01-07 17:18:01 +08:00
co-authored by Claude Sonnet 4.5
parent 7e96bc86d8
commit 99bef309b7
86 changed files with 1858 additions and 981 deletions
+16 -8
View File
@@ -95,7 +95,8 @@ TSL 语言中,有两种可执行单元,它们分别是函数定义体和函
函数返回参数类型可以任意类型。
TSL 仅允许 return 一个值,如果需要返回多个内容,建议用户使用数组来包装返回,例如 return array(X,Y);
TSL 仅允许 return 一个值,如果需要返回多个内容,建议用户使用数组来包装返回,例如 return
array(X,Y);
### 主函数与子函数
@@ -621,7 +622,8 @@ v:=abcd(a,b,c);//此时,a,b,c都为形参
方式二:用户还可以用 In out 前缀指示送入的是形参还是实参。
例如调用 abcd(in a,out b,c)这样就是 a 为形参, b 为实参, c 为默认模式(编译选项指定的)
例如调用 abcd(in a,out
b,c)这样就是 a 为形参, b 为实参, c 为默认模式(编译选项指定的)
### 一些注意事项
@@ -943,7 +945,8 @@ TSL 调用动态库的函数申明基本与 PASCAL 的申明方式相同。
例如我们要调用一个 Windows 的函数 GetTickCount,我们可以申明:
Function GetTickCount():Integer; stdcall; external "kernel32.dll" name "GetTickCount" KeepResident;
Function GetTickCount():Integer; stdcall; external "kernel32.dll" name
"GetTickCount" KeepResident;
Stdcall:是调用方式,对于操作系统库基本是 STDCALL,而 C++开发的动态库则是 CDECL,
@@ -998,7 +1001,8 @@ TSL 调用外部函数指针
##### TSL 调用外部动态库的函数
语法:Function newFuncName(p1:DataType;p2:Datetype;…):returnType;external FuncDLL name FuncName;
语法:Function newFuncName(p1:DataType;p2:Datetype;…):returnType;external
FuncDLL name FuncName;
其中,多个参数用;隔开,注意每个参数的参数类型要与原函数对应
@@ -1028,7 +1032,8 @@ Function TSstrtofloat(s:string):double;external "tslkrnl.dll" name "TS_strtofloa
使用说明:
TSLfunPointer:=function(p1:DataType;p2:Datetype;…):returnType;external funcPointer;
TSLfunPointer:=function(p1:DataType;p2:Datetype;…):returnType;external
funcPointer;
其中,funcPointer 为外部函数指针,TSLfunPointer 为返回结果,即为天软函数指针。
@@ -1078,11 +1083,13 @@ Windows 的 API 使用 stdcall 模式。
默认情况下,我们采用 cdecl 申明模式:
Function TS_strtofloat(s:string):double;external "tslkrnl.dll" name "TS_strtofloat";
Function TS_strtofloat(s:string):double;external "tslkrnl.dll" name
"TS_strtofloat";
等同于:
Function TS_strtofloat(s:string):double;cdecl;external "tslkrnl.dll" name "TS_strtofloat";
Function TS_strtofloat(s:string):double;cdecl;external "tslkrnl.dll" name
"TS_strtofloat";
除了 Win32 以外,每种 CPU 架构下只有一套标准调用模式,不需考虑是 stdcall 还是 cdecl。目前只有 Win32 还需要考虑调用方式的申明。
@@ -1249,7 +1256,8 @@ string s = "f1:=MakeInstance(findfunction('TS_inttodate')); return f1;//对天
##### 多线程调用案例
创建多线程程序例子:利用 windows API 的 CreateThread 函数创建多线程调用,通过控制台结束指定线程。
创建多线程程序例子:利用 windows
API 的 CreateThread 函数创建多线程调用,通过控制台结束指定线程。
代码如下: