It is currently 21 April 2025, 13:24 Advanced search

Bug! - v21

Questions and answers on how to best use Instant Developer

Bug! - v21

Postby john w » 13 May 2021, 14:08

When I go to run my existing app in v21 I get this error msg about OpenDocument. It shows in the desktop and web versions of the IDE. Its kinds of show stopper for me.... It ran in v20.5


Ashampoo_Snap_2021.05.13_8h52m40s_001_localhost4400clientindex.html - First user - Microsoft Edge.png
Ashampoo_Snap_2021.05.13_8h52m40s_001_localhost4400clientindex.html - First user - Microsoft Edge.png (70.14 KiB) Viewed 2563 times
Regards

John W
User avatar
john w
 
Posts: 834
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA

Re: Bug! - v21

Postby john w » 13 May 2021, 14:58

The answer seems to be that that v21 is does not like the keyword 'this'. I needed to replace that with the defined name of the application to call the 'OpenDocument' method.

So onward.
Regards

John W
User avatar
john w
 
Posts: 834
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA

Re: Bug! - v21

Postby lucabaldini » 17 May 2021, 13:41

Hi.

In version 21 we've added a new check that works this way: for every [OBJECT].[METHOD] call I check if the METHOD is inside OBJECT's library. It should... but it was never checked... Now I need to check it because the new ClientLibrary inside panel's cells allows the programmer to call yellow libraries' methods... but then if you remove the yellow library the app would not compile.

Anyway... it should give error if there IS an error.

I've seen in one of my old projects that there were error similar to what you are showing... I had a "this.executeOnClient" where "this" was a FORM... that was not allowed... but it was generating the right code... even if the executeOnClient method was not inside the FORM's library (it's inside APP's library).

Now... what is Solomoncalculatorv2? An app? The OpenDocument method can be used only if the object before the dot is an app... and what is "this" in your code? Are you inside a global method? Or a form method? In the latter case that's invalid... this is the form and you need to replace the "this" with an app reference.

It could happen if you moved a "global" method inside a form... the "this" in that case have to be relinked to "form".
User avatar
lucabaldini
Pro Gamma
Pro Gamma
 
Posts: 4990
Joined: 1 October 2010, 17:03
Location: Bologna

Re: Bug! - v21

Postby lucabaldini » 17 May 2021, 13:43

Can you check it for me?

If you are unable to do so, can you send the project to me so that I can look at it and see what's wrong?

Thanks.

P.S. If you change "this" with the app and it works it should work even if you go back to version 20.5 and previous...
User avatar
lucabaldini
Pro Gamma
Pro Gamma
 
Posts: 4990
Joined: 1 October 2010, 17:03
Location: Bologna

Re: Bug! - v21

Postby john w » 17 May 2021, 16:09

Luca - SolomonCalculatorv2 is a form in the application. I have a hyperlink button on the form. In v20.5 and earlier I was able to use "This.OpenDocument". In v21 I needed to replace "This.OpenDocument" with "SolomonAdjustmentCalculators2022.OpenDocument"

Why it worked in earlier versions I do not know. When it failed in V21 I rolled back to v20.5 and it worked. When I moved back to v21 I had to make the change.

So the app is working in v21 with the changes made. I will say being able to use the This reference was useful for me.
Regards

John W
User avatar
john w
 
Posts: 834
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA

Re: Bug! - v21

Postby lucabaldini » 17 May 2021, 16:33

Ok, I understand... the "problem" is that "this" is wrong in that case... if you are inside a form.

If you would use any language (C#, Java, Javascript, C++, etc..) where you have the "this" token you have to decide what type this is... if you are inside a class (a form) this is the current instance...

When you write code inside the form "this" is the form... and the form library does not have a openDocument method... The app has one.

In version 20.5 and before this.openDocument was accepted but was wrong... fortunately InDe generated the right code even if the expression was not correct.

In version 21.0 I had to check for method/object match...

If you want to use app's methods (like openDocument) you have to use the app (SolomonAdjiustmentCalculators2022)... Fortunately you don't have to write everything... just type "S" and the first object in the intellisense combo it's probably gonna be the app you are looking for.

User avatar
lucabaldini
Pro Gamma
Pro Gamma
 
Posts: 4990
Joined: 1 October 2010, 17:03
Location: Bologna

Re: Bug! - v21

Postby john w » 17 May 2021, 16:50

Thanks for the explanation. It helps me to understand why it worked in one version and not the next. I understand what I need to do from this point forward.
Regards

John W
User avatar
john w
 
Posts: 834
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA


Return to Tips & Tricks

Who is online

Users browsing this forum: No registered users and 31 guests

cron