FastReport中国社区FastReport联系电话 联系电话:023-68661681

FastReport用户手册(十二)脚本

来源:   发布时间:2016-08-08   浏览:7312次

虽然脚本的结果取决于所使用的语言,但也有一些共同元素,如脚本的标题,正文,主要程序,这些都会在报表运行的时候执行。本文例举了FastReport所支持的所有语言的脚本例子:

PascalScript结构:

#language PascalScript // optional
program MyProgram; // optional
// the “uses” chapter should be located before any other chapter
uses 'unit1.pas', 'unit2.pas';
var // the “variables” chapter can be placed anywhere
i, j: Integer;
const // “constants” chapter
pi = 3.14159;
procedure p1; // procedures and functions
var
i: Integer;
procedure p2; // nested procedure
begin
end;
begin
end;
begin // main procedure.
end.

C++Script结构:

#language C++Script // optional
// the “include” chapter should be placed before any other chapter
#include "unit1.cpp", "unit2.cpp"
int i, j = 0; // the “variables” chapter can be placed anywhere
#DEFINE pi = 3.14159 // “constants” chapter
void p1() // functions
{ // no nested procedures
}
{ // main procedure.
}

JScript结构:

#language JScript // optionally
// the “import” chapter should be before any other chapter
import "unit1.js", "unit2.js"
var i, j = 0; // the “variables” chapter can be located
anywhere
function p1() // functions
{ //
}
// main procedure.
p1();
for (i = 0; i < 10; i++) j++;

BasicScript结构:

#language BasicScript ' optionally
' the “imports” chapter should be located before Any other chapter
imports "unit1.vb", "unit2.vb"
Dim i, j = 0 ' the “variables” chapter can be placed anywhere
Function p1() ' functions
{ '
}
' main procedure.
For i = 0 To 10
p1()
Next

本站文章除注明转载外,均为本站原创或翻译
欢迎任何形式的转载,但请务必注明出处,尊重他人劳动成果
转载请注明:文章转载自:FastReport控件中文网 [https://www.fastreportcn.com/]
本文地址:https://www.fastreportcn.com/post/1208.html

联系我们
  • 重庆总部 023-68661681
购买
  • sales@evget.com
合作
  • business@evget.com


在线
客服
微信
QQ 电话
023-68661681
返回
顶部