定义一个枚举类
  TOperation=(TEST_START,TEST_END);一个函数,其中一个行参定义为枚举类TOperation
function TMyRS232.AT_VibratorTest(operation: TOperation;
  var errormsg: string): boolean;
begin
   case operation of
       TEST_START:
          cmdstring:='AT+CVIB=1';
       TEST_END:
          cmdstring:='AT+CVIB=0';
   end;  
    
   //.....end;我试着用以下方法来调用这个函数
1。AT_VibratorTest(TEST_START,errormsg) 出错****************************************************2。AT_VibratorTest([TEST_START],errormsg)  出错***************************************************3。
var operation_type:TOperation
begin
operation_type:=[TEST_START];     也出错
AT_VibratorTest(operation_type,errormsg)  请问我该怎么调用这个函数???

解决方案 »

  1.   

    以上用法,提示错误为:
    Incompatible types:'TOperation' and 'procedure ,untyped pointer or untyped parameter'
      

  2.   

    第一种方法AT_VibratorTest(TEST_START   对着呢。考虑别的地方出错吧。
      

  3.   

    但是第一种方法确实报错:
    Incompatible types:'TOperation' and 'procedure ,untyped pointer or untyped parameter'还有TOperation 和 AT_VibratorTest 是写在组件里头的,那么如果我要调用的话是不是要在本地再定义一下TOperation=(TEST_START,TEST_END) 
      

  4.   

    照兄弟门说的,那问题一定出在因为TOperation 是在组件里定义的了