FireFly 3.78 Crashes on Compile

Started by Richard Marchessault, October 31, 2016, 02:48:51 PM

Previous topic - Next topic

Richard Marchessault

I have the 32 bit version of FreeBasic (1.05.0) installed on my system. I was using the 3.77 version of FireFly to convert a program written for PB to FB. Was doing well but then FireFly began to crash with each compile. Downloaded and installed 3.78 of FireFly. Still getting a crash on compile.

Any thoughts on how to get out of this problem?
Thanks,
Dick

Paul Squires

Too hard to diagnose at this point. I would need to see the code and the setup of your system. Could be just about anything at this point. Maybe try generating the CODEGEN*.* files and see at which file the problem occurs in. If all CODEGEN files get produced then the crash is occurring during the actual FB compile. In that case, compile the CODEGEN*.BAS file directly from the command line using the FB compiler (rather than using FireFly). You should maybe/hopefully see the error then.

I have seen these types of crashes when an error exists in your code (most likely in an INCLUDE file) and FireFly tries to position the editor to the failing code. Sometimes it fails. I thought that I fixed most of those types of crashes but this could be a case of it.
Paul Squires
PlanetSquires Software

Richard Marchessault

I was able to work around the problem by approaching the project differently.

I had a relatively small program with one form and supporting code. The program was written for the PowerBasic compiler. I decided to create a version of it written for the FreeBasic compiler.

My first approach was to make a copy of the program and open it with FireFly for FreeBasic. I then began compiling the program and noting the compilation errors. I was then making corrections to the code, step by step, by repeatedly compiling and correcting. The number of errors decreased and I thought I was on my way to a successful compile. However, at one point in this effort when I initiated the compilation, FireFly crashed. Repeated attempts to compile made no difference, FireFly crashed each time. That is when I made this post asking for suggestions.

While waiting for a reply, I decided to take a different approach to this conversion. I made another copy of the PowerBasic version and opened it with FireFly for FreeBasic. This time I commented out most of the code in the program, leaving just the code needed to create and close the form. This compiled and ran without an error. I then focused on converting and testing the code for each of the Functions, one by one. When one Function compiled and ran without an error, I would move on to the next. With this approach I was able to create the application in FreeBasic which now compiles and works just fine.

In the process of this conversion I learned much about FreeBasic and what I will need to do to convert other applications. One of the lessons is how much I will miss the richness of the PowerBasic language. For example, PowerBasic has UCase, LCase and MCase. With FreeBasic I had to create my own MCase routine. I made use of the PowerTime functionality in PowerBasic but had to create my own code for this in FreeBasic. Error handling was also a challenge. Even the Rnd(a,b) function in PowerBasic was absent in FreeBasic so I had again to create my own code for this. I expect to encounter more of these challenges as I continue to convert to FreeBasic especially with the integration of DLL's I routinely use. The Help in FreeBasic is also inferior to that in PowerBasic in that it often raises more questions than it answers and gives few examples of usage.

Thanks for your prompt response to my post.
Thanks,
Dick

Paul Squires

Hi Dick, very happy to hear that you were able work around the problem and get your application to work. You are correct that there are some challenges when moving from to a new language. For the most part, I found switching to FB relatively painless especially after we wrote a collection of PB replacement string handling routines. I also agree with you that you may find it challenging when you start to try to use DLL's from your PB application into FB. PB uses BSTR strings whereas FB by default uses traditional C style null terminated strings. Jose has done a great job creating BSTR and Unicode WSTR string replacement classes that should help. That code has certainly helped me.
Paul Squires
PlanetSquires Software

Richard Marchessault

The one DLL I really would like to use with FreeBasic is My Little Grid. Do you know anyone who has used this DLL with FreeBasic and might be willing to share how to get the job done?
Thanks,
Dick