PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Marc van Cauwenberghe on December 09, 2009, 06:04:33 AM

Title: End Function BUG
Post by: Marc van Cauwenberghe on December 09, 2009, 06:04:33 AM
This can be very difficult to catch and it happened to a few times.
Just add a function in a module without the 'End Function' part. FF3 crashes.


Function DoSomething (lLong As Long) As String
   lTel& = lTel1
   Function = "crash"
Title: Re: End Function BUG
Post by: Rolf Brandt on December 09, 2009, 07:33:33 AM
I think a feature like in the SED editor would be a good idea. If you finish a line with Function () or sub it automatically adds End Function or End Sub.

Personally when I write a Function line I always add right away the End Function line. Similar I do this with If.., Select Case, etc.
Title: Re: End Function BUG
Post by: Andy Flowers on December 09, 2009, 01:07:11 PM
It would be a good idea to automatically add the End Function.

I've had a few crashes with this as well. Now I learned to add the End Function as soon as I create the function.
Title: Re: End Function BUG
Post by: Marc van Cauwenberghe on December 09, 2009, 01:17:08 PM

It would indeed be nice, but nevertheless FF3 should not crash.

Marc
Title: Re: End Function BUG
Post by: Paul Squires on December 09, 2009, 02:23:29 PM
Hi Marc,

That is a tough error to catch because the error occurs based on the main file rather than in the actual form/module file where the missing END SUB or END FUNCTION occurs. This is because those files are #INCLUDE'd in the main source file for code generation and code compilation purposes.

I have added a specific error check for Error 454 and Error 458. You will no longer get a GPF or positioning of the editor to the FF_WinMain or FF_PumpHook functions.

The fix will be in v3.05.

Title: Re: End Function BUG
Post by: Paul Squires on December 09, 2009, 02:25:10 PM
I have also opened a ticket for a new feature request to automatically append an END FUNCTION or END SUB after a Sub/Function line is created. Basically, the same functionality that exists in FF2.