Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Zap DBF if no error occurs
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01016146
Message ID:
01016434
Views:
7
To accurately mimic the code in VFP 6 would take the following...
Local lError, cErrorHandlingWas
lError = .F.
cErrorHandlingWas = ON("Error")
ON ERROR llError = .T.
OPEN DATABASE cFolder2+'\TABLES\ACCOUNT.DBC'
if !lError
  USE vouchers EXCLUSIVE
  if !lError
    ZAP
    if !lError
      USE VOU_SUM EXCLUSIVE
      if !lError
        ZAP
        if !lError
          USE VOU_NO EXCLUSIVE
          if !lError
            ZAP
          endif
        endif
      endif
    endif
  endif
endif

on error &cErrorHandlingWas

If lError
  MessageBox("Error erasing data")
  Return .F.
Else
  Return .T.
Endif
>Dear Sir, Alex Feldstein
>
>Please modify your following codes to work with VFP6
>
>Local lError
>Try
>  OPEN DATABASE cFolder2+'\TABLES\ACCOUNT.DBC'
>  USE vouchers EXCLUSIVE
>  ZAP
>  USE VOU_SUM EXCLUSIVE
>  ZAP
>  USE VOU_NO EXCLUSIVE
>  ZAP
>Catch to oErr
>  lError = .T.
>  * you could use oErr exception object information to see what happenned.
>Endtry
>
>If lError
>  MessageBox("Error erasing data")
>  Return .F.
>Endif
>
>Thanks
Previous
Reply
Map
View

Click here to load this message in the networking platform