FoxPro Programming
Multiple RETURNs inside Try/Catch-Block
Gravatar is a globally recognized avatar based on your email address. Multiple RETURNs inside Try/Catch-Block
  Toni Köhler
  All
  Oct 15, 2026 @ 10:20am

Hi Rick,

I found multiple RETURNs inside a Try/Catch-Block. It runs into error 2060. Lineno is based on Web-Connection 8.5

Gravatar is a globally recognized avatar based on your email address. re: Multiple RETURNs inside Try/Catch-Block
  Rick Strahl
  Toni Köhler
  Oct 16, 2026 @ 12:07pm

Damn that's quite a few of them. I always forget that this doesn't work which is such a PITA especially since the compiler doesn't flag it. It makes sense that you can't return from a catch block but it's silly we can't return from a try block.

IAC, I've fixed all of these.

What are you using for your editor that is flagging these?

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Multiple RETURNs inside Try/Catch-Block
  Toni Köhler
  Rick Strahl
  Oct 18, 2026 @ 05:53pm

The errors are reported by my own VScode extension. I will deploy it for free to our FoxPro community in future. The extension is in progress and I will implement more and more VFP functionality into it.

If you want, I can share the VSIX file for your personal use as early version. It will be helpful, because I can only check the extension on my code base. So you can report issues or ideas.

Gravatar is a globally recognized avatar based on your email address. re: Multiple RETURNs inside Try/Catch-Block
  Rick Strahl
  Toni Köhler
  Oct 19, 2026 @ 06:25pm

Sure would love to check it out. Would be useful to compile all code and see dependencies.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Multiple RETURNs inside Try/Catch-Block
  Richard Kaye
  Rick Strahl
  Oct 22, 2026 @ 05:15am

FWIW there's a Thor tool that checks for RETURNs in places they don't belong.

© 1996-2026