重发:200分悬赏:将VB代码转换为Delphi代码.(200)

  • 主题发起人 主题发起人 yeszhang
  • 开始时间 开始时间
Y

yeszhang

Unregistered / Unconfirmed
GUEST, unregistred user!
VB 是这样定义的:Private ftBackupNumber As Variant这样赋值的: ftBackupNumber = Array(BACKUP_FP_0, "Fp-0", _ BACKUP_FP_1, "Fp-1", _ BACKUP_FP_2, "Fp-2", _ BACKUP_PSW, "Pass", _ BACKUP_CARD, "Card")........... cmbBackupNumber.Clear For vnii = 1 To UBound(ftBackupNumber) Step 2 cmbBackupNumber.AddItem (ftBackupNumber(vnii)) Next vnii改成Delphi怎么弄?
 
大意如下:procedure TForm1.cmdGetAllEnrollData_Click(Sender: TObject);var vEnrollNumber: Integer; vBackupNumber: Integer; vPrivilege: Integer; vnEnableFlag: Integer; vnMessRet: Integer; vTitle: string; vnResultCode: Integer;begin cmdGetAllEnrollData.Enabled := False; lstEnrollData.Clear; vTitle := Me.Caption; lblMessage.Caption := 'Working...'; DoEvents; vnResultCode := frmMain.FKAttend.EnableDevice(0); if vnResultCode <> RUN_SUCCESS then begin lblMessage.Caption := gstrNoDevice; cmdGetAllEnrollData.Enabled := True; Exit; end; vnResultCode := frmMain.FKAttend.ReadAllUserID(); if vnResultCode <> RUN_SUCCESS then begin lblMessage.Caption := ReturnResultPrint(vnResultCode); frmMain.FKAttend.EnableDevice(1); cmdGetAllEnrollData.Enabled := True; Exit; end; MousePointer := vbHourglass; with AdoEnroll.Recordset do begin fbGetState = True do label FFF vnResultCode := frmMain.FKAttend.GetAllUserID(_vEnrollNumber, _vBackupNumber, _vPrivilege, _vnEnableFlag); if vnResultCode <> RUN_SUCCESS then begin if vnResultCode = RUNERR_DATAARRAY_END then vnResultCode = RUN_SUCCESS end if Break label EEE vnResultCode := frmMain.FKAttend.GetEnrollData(_vEnrollNumber, _vBackupNumber, _vPrivilege, _flngFpData(0), _flngPasswordData); if vnResultCode <> RUN_SUCCESS then begin vnMessRet = Application.MessageBox( PChar(ReturnResultPrint(vnResultCode)+': Continue ?'),'GetEnrollData',mbYesNoCancel); if vnMessRet = mrYes then goto EEE else if vnMessRet = mrCancel then Break else goto FFF end; FuncSaveToDB(vEnrollNumber, vBackupNumber, vPrivilege); Me.Caption := IntToStr(vEnrollNumber); DoEvents; // Loop fbGetState := False; DoEvents; if RecordCount > 1 then begin MoveFirst; MoveLast; end; end; Me.Caption := vTitle; MousePointer := vbDefault; if vnResultCode = RUN_SUCCESS then lblMessage.Caption := 'GetAllEnrollData OK' else lblMessage.Caption := 'GetAllEnrollData Error: ' + ReturnResultPrint(vnResultCode); frmMain.FKAttend.EnableDevice(1); cmdGetAllEnrollData.Enabled := True;end;
 
请教一下:这个东西在Delphi怎么定义呢?Const DATASIZE = 459 Private flngFpData(DATASIZE) As Long Private fbytFpData(DATASIZE * 5) As Byte
 
Const DATASIZE = 459;flngFpData( DATASIZE:Integer ) As Integer;
 
var flngFpData( DATASIZE:Integer ) As Integer; 能编译?
 
呵呵,错了flngFpData [1..DATASIZE] of Integer
 
呵呵.大侠再问你一个问题:vnResultCode = frmMain.FKAttend.GetEnrollData( _ vEnrollNumber, _ vBackupNumber, _ vPrivilege, _ flngFpData(0), _ flngPasswordData)明明定义的是vPrivilege,为何前面要加个_呢?是不是有特殊用法?
 
第一个函数中 有个 Loop..为什么要注释掉呢?按理论上来说第一个函数是需要循环的.流程是这样的:从指纹机里面取出所有用户指纹. 再将用户指纹一条一条插入数据库中.应该有个循环的...那VB的表示循环插入数据库的段代码在哪呢?只看到了一个FuncSaveToDB 后面有个Loop..
 
麻烦你了...呵呵.
 
ftBackupNumber = Array(BACKUP_FP_0, "Fp-0", _ BACKUP_FP_1, "Fp-1", _ BACKUP_FP_2, "Fp-2", _ BACKUP_PSW, "Pass", _ BACKUP_CARD, "Card")写成Delphi 怎么写?
 
接受答案了.
 
后退
顶部