Fabrice Harari International WinDev Consultant

Home         About Fabrice         WinDev Files        Products        Fabrice's blog         Consulting        Contact Fabrice        Links

My status

Random errors: what can cause them

Class method name length:
Under WinDev 5.5, a class method name is supposed to support up to 30 characters, but it's a very good idea to never use more than 25... The trap is that you can enter up to 30 when you define a new method, but if you do, you WILL get a GPF... Of course, not always immediately (seems OS dependent)...

 

{AmazonLinks}


What's even more amusing is that it's not the name of the method per se who is causing the problem but the name used on the first line of the method, in the procedure xxx() statement... Nothing is done to avoid that you modify the name of the procedure on the first line (of course I strongly suggest that you keep that name the same than the procedure name itself), but when you rename a method, this line is NOT changed by the editor, so you can have discrepancies here... So, if you rename a method and extend its name, but don't change the first line of the code and therefore don't exceed 25 characters here, nothing happen (at least immediately)... And on the contrary, if you have a method whose name is no more than 25 long, but where you have change the fist line of code with a name longer than 25, you will get a GPF at some point...

During my test, I created a very simple class with 2 methods (one 25, one 30), each only doing an info("Test25") or Info("Test30")... Of course these two methods had name 25 and 30 long. In my only window, I was doing:

oTest is clMyClass
oTest:Test567890123456789012345()
oTest:Test56789012345678901234567890()

You would think that you would get the GPF when trying to execute the 3rd line above... But no, I got a GPF FIRST, and when I clicked ignore, I got the display of Test25, and then the display of Test30... In a 3 lines long program, the GPF was already not occurring at the exact time of the execution... Imagine the kind of problem to find what's going on in a big and complex project...

 

File's fields name length:
And the same thing is true for the file fields, try it, it's very interesting... You can type up to 30 characters in the file field name... Let's say that you define a file named Test2530 (abbr. TE), and a field in it called sName3089012345678901234567890... Everything works well in the analysis editor...

If you use in your code TE.sName3089012345678901234567890, everything works fine (sometime), but if you use Test2530.sName3089012345678901234567890, you have not one message but TWO in the code editor saying that the identifier is too long... Of course, if you are using the indirection operators { and }, you have no message in the code editor, but you'll get one at the execution time...

Try it with sName25890123456789012345, and you'll have the same problem... Try it with a name 24 characters long, and you have no problem...

And in some cases (but I haven't been able to identify exactly when), you will get a GPF, and of course not exactly when you are using this variable, but later...

Google
 
Web www.fabriceharari.com
Links:


Last modified Friday, March 17, 2006 12:10 PM central time