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

FastReport用户手册(十四)从报表的变量列表中调用变量

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

你可以从脚本中调用任何指定在FastReport报表变量列表中的变量((“Report|Variables..." menu item)。变量的名称包含在尖括号中:

PascalScript:
if <my variable> = 10 then ...

C++ Script:
if (<my variable> == 10) { ... }
An alternative way is to use the “Get” function:

PascalScript:
if Get('my variable') = 10 then ...

C++ Script:
if (Get("my variable") == 10) { ... }
Modification of such variable’s value is available only via the “Set” procedure:

PascalScript:
Set('my variable', 10);

C++ Script:
Set("my variable", 10);

可通过“设置”程序修改的有关变量的值:

PascalScript:
Set('my variable', 10);

C++ Script:
Set("my variable", 10);

关于字符串赋值,值得注意的是,你需要使用额外的括号:

PascalScript:
Set('my variable', '''' + 'String' + '''');

C++ Script:
Set("my variable", "\"String\"");

处理系统变量,以“Page#”为例:

PascalScript:
if <Page#> = 1 then ...

C++ Script:
if (<Page#> == 1) { ... }

 

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

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


扫码咨询
电话咨询
023-68661681
返回
顶部