procedure Memo31OnAfterData(Sender: TfrxComponent);
var
CI:boolean;
begin
CI:=true;
if Pos('200',Memo31.Memo.Text)then
begin
if CI=true then
begin
CI:=false;
Memo31.Color:=claqua;
end
else
begin
Memo31.Color:=clcream;
CI:=true;
end;
end;
if Pos('IC',Memo31.Memo.Text) then
begin
if CI=true then
begin
Memo31.Color:=claqua;
CI:=false;
end
else
begin
Memo31.Color:=clcream;
CI:=true;
end;
end;
end;
这是写在fastreport的脚本程序。目的是使根据memo31显示的内容(来自adoquery)给memo31赋不同的背景色。
程序运行的效果应该是。
200 //背景色是claqua
ic //背景色是clcream
以上是同时显示的,不是只有200而没有ic,或只有ic而没有200
不知为什么,程序运行的效果却是:
200 //背景色是claqua
ic //背景色是claqua
也就是说在第二个if语句里虽然有CI:=false语句却CI仍然为True;导致了第四个if语句成立,才有
ic //背景色是claqua?
也就是说在第二个if语句里虽然有CI:=false语句但不起作用????
百思不得其解
var
CI:boolean;
begin
CI:=true;
if Pos('200',Memo31.Memo.Text)then
begin
if CI=true then
begin
CI:=false;
Memo31.Color:=claqua;
end
else
begin
Memo31.Color:=clcream;
CI:=true;
end;
end;
if Pos('IC',Memo31.Memo.Text) then
begin
if CI=true then
begin
Memo31.Color:=claqua;
CI:=false;
end
else
begin
Memo31.Color:=clcream;
CI:=true;
end;
end;
end;
这是写在fastreport的脚本程序。目的是使根据memo31显示的内容(来自adoquery)给memo31赋不同的背景色。
程序运行的效果应该是。
200 //背景色是claqua
ic //背景色是clcream
以上是同时显示的,不是只有200而没有ic,或只有ic而没有200
不知为什么,程序运行的效果却是:
200 //背景色是claqua
ic //背景色是claqua
也就是说在第二个if语句里虽然有CI:=false语句却CI仍然为True;导致了第四个if语句成立,才有
ic //背景色是claqua?
也就是说在第二个if语句里虽然有CI:=false语句但不起作用????
百思不得其解
解决方案 »
- 吗的,碰到借钱不还的同学
- 一个关于EXCEL的问题
- 一個小問題?急!
- 有条语句在Delphi中我会用,但在BCB中提示出错,请大家帮个忙。
- 求助:我的下拉框所要显示的内容比下拉框本身大,我该如何设置什么属性的,让它所有部分
- 如何改变IDE 中各模块的名称?
- 急救!下载DELPHI5.0
- (救命)局域网语音聊天技术?(超级紧急)
- 这么难!!!谁知道如何直接将webbrowser显示的页面保存为mht格式的文件啊?
- 1.我的WIN 98系统怎么了??
- 在几组或几十组由七位数字组成的字符串,计算出每列数字出现频率的百分比
- 超难: ADO/BDE连接SQL Server,TADOQuery/TQuery执行SQL语句出现"Lick time out \n SQL Server 连接超时"
begin
if Pos('200', Memo31.Memo.Text) > 0 then
Memo31.Color := clAqua;
if Pos('IC', UpperCase(Memo31.Memo.Text)) > 0 then
Memo31.Color := clCream;
end;
类型 //字段名
200 //内容
IC //内容fastreport设计如下:
memo1 //里面有固定值“类型”
memo2 //值从adoquery传过来[*."类型"]现在我通过select * from 表名,将表中的东东在fastreport里显示。
显示内容应该是:
类型 //memo1
200 //memo2
IC //memo2现在我想
类型 //memo1
200 //memo2 此处的memo背景色为claqua
IC //memo2 此处的memo背景色为clcream也就是说两种色交替出现