Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Try...Catch Problem
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Try...Catch Problem
Miscellaneous
Thread ID:
00810260
Message ID:
00810260
Views:
43
I have the following code that I am trying to perfect to automate the setting of a header file in several forms in a particular folder.
lcFolder = GETDIR(CURDIR(), 'Forms Folder', ;
   'Select folder where your forms are located...')
IF EMPTY(lcFolder)
   RETURN
ENDIF
lnRetVal = ADIR(laForms, ADDBS(lcFolder) + [*.SCX])
FOR lnI = 1 TO lnRetVal
   TRY
      lcForm = laForms[lnI, 1]
      KEYBOARD '{Alt+M}I{Tab}{Tab}' + lcHeaderFile + '{Enter}{Ctrl+W}'
      MODIFY FORM (lcForm)
   CATCH
      KEYBOARD '' CLEAR
   ENDTRY
ENDFOR
The code executes fine unless the form can not be modified because, for an example, a ClassLib can not be found for some object on the form. No matter what I put in Catch, I still get an error messagebox appearing. This is for error 2005. Is there a problem with my code or is error 2005 not trappable? TIA!
Mark McCasland
Midlothian, TX USA
Next
Reply
Map
View

Click here to load this message in the networking platform