例如
a:string
a:='(checkbox4.checked=true)'+' and '+'(strtoint(get_s7)>=3)'怎样引用变量a,写成如下的样式
if a then    --这样写系统提示a必须是bool型的,出错。来实现
if (checkbox4.checked=true) and (strtoint(get_s7)>=3) then的效果?

解决方案 »

  1.   

    function IsTrue(s: string): Boolean;
      

  2.   

    var
    a:string;
    i:integer;
    if checkbox4.checked then
      i :=1
    else i:=0;a:='(i=1)'+' and '+'(strtoint(get_s7)>=3)'
      

  3.   

    搞错了`~`
    var
    a,i:string;if checkbox4.checked then
      i :=1
    else i:=0;a:='('+i+'=1)'+' and '+'(strtoint(get_s7)>=3) ';  
      

  4.   

    这个要用脚本了吧。
    在执行期间解析字符串,去www.2ccc.com下载script控件吧。