Source language: Translate to:

Bug of SDK function?

Questions about NeoBook PlugIns

Moderator: Neosoft Support

Bug of SDK function?

Postby Peter » Tue Jul 02, 2013 11:23 am

Hi Neosoft!

I have noticed the bug in the SDK, specifically in the returned result of the function nbInterface.
nbInterface (2, Data) will execute the code editor.
If in the code editor to clear all the lines (empty script) and press OK button, then the function returns not empty Data (Data remains the same).
What may I do?
Is it possible to fix this bug in the future?

I use the Turbo Delphi
User avatar
Peter
 
Posts: 29
Joined: Thu Sep 27, 2012 4:41 pm
Location: St.Petersburg, Russia

Re: Bug of SDK function?

Postby HPW » Tue Jul 02, 2013 12:53 pm

Edited:

I have the same problem in my plugins (had not noticed it until now)

I also think it is a bug.

But i would not open the Action Editor to delete the Action string.
I would delete the string directly in my wizard.


Regards
Hans-Peter
User avatar
HPW
 
Posts: 2521
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: Bug of SDK function?

Postby Peter » Tue Jul 02, 2013 1:34 pm

Thank you, Hans-Peter!

I have not thought to check the function to False.
Strange...
The function is boolean, and Data (as text of editor) should be returned as a pointer and used in any case.
Now everything is working.

Thank you again!
Last edited by Peter on Tue Jul 02, 2013 4:59 pm, edited 1 time in total.
User avatar
Peter
 
Posts: 29
Joined: Thu Sep 27, 2012 4:41 pm
Location: St.Petersburg, Russia

Re: Bug of SDK function?

Postby Neosoft Support » Tue Jul 02, 2013 2:09 pm

Yes, you have to check the value returned by nbInterface to know if the the data returned is valid.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: Bug of SDK function?

Postby Peter » Tue Jul 02, 2013 2:15 pm

HPW wrote:
I also think it is a bug.

But i would not open the Action Editor to delete the Action string.
I would delete the string directly in my wizard.


It is reasonable!
But neobuker can use the main editor, and that's when misunderstandings arise.

Thank you again!
User avatar
Peter
 
Posts: 29
Joined: Thu Sep 27, 2012 4:41 pm
Location: St.Petersburg, Russia

Re: Bug of SDK function?

Postby Peter » Tue Jul 02, 2013 2:19 pm

Neosoft Support wrote:Yes, you have to check the value returned by nbInterface to know if the the data returned is valid.

I will keep it in my mind.

Thank you!
User avatar
Peter
 
Posts: 29
Joined: Thu Sep 27, 2012 4:41 pm
Location: St.Petersburg, Russia

Re: Bug of SDK function?

Postby Peter » Tue Jul 02, 2013 4:52 pm

Opps...
The decision to check for False of function (and clean text in plugin's memo) do not fit!
The bug still present...
:(
If the user closes the editor's window by system "Close" button or press "Cancel", the function nbInterface returns False too.
For different events there is one result - False

It is need to think of something else...
User avatar
Peter
 
Posts: 29
Joined: Thu Sep 27, 2012 4:41 pm
Location: St.Petersburg, Russia

Re: Bug of SDK function?

Postby Neosoft Support » Fri Jul 05, 2013 10:19 am

Can you post the code you're using? Is it Delphi?
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: Bug of SDK function?

Postby HPW » Fri Jul 05, 2013 12:05 pm

Hello,
Here is a sample from one of my wizards:
Code: Select all
procedure TEditForm2PA.SpeedButton3Click(Sender: TObject);
VAR Data : PCHAR;
begin
  IF Assigned( nbInterface ) THEN
    TRY
      Data := NIL;
      SetStr( Data, Memo1.Lines.Text );
      IF nbInterface( 2, Data ) THEN
        Memo1.Lines.Text := StrPas( Data );
    FINALLY
      FreeStr( Data );
    END;
end;


The memo hold some action code.
Then I press SpeedButton3 and the editor opens.
I delete all code. I presss OK in the editor.
The memo is not cleared, but has the old code.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2521
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: Bug of SDK function?

Postby Peter » Fri Jul 05, 2013 4:37 pm

This is my code (like code of Hans-Peter):

Code: Select all
procedure TNeoMemo.DoOnEditBtnClick(Sender : TObject);
var Data : PChar;
begin
   if Assigned(FOnEditBtnClick) then
     FOnEditBtnClick(Self)
    else
    if Assigned(nbInterface) then
    try
      Data := nil;
      SetStr(Data, NeoText);
      if nbInterface(2, Data) then
         NeoText:= StrPas(Data);
     finally
      FreeStr(Data);
    end;
end;


NeoMemo - my custom component similar standart Delphi Memo.
The same problem - if I delete all code in NeoBook's code editor and press OK, my NeoMemo still holds old code.

Best Regards
User avatar
Peter
 
Posts: 29
Joined: Thu Sep 27, 2012 4:41 pm
Location: St.Petersburg, Russia

Re: Bug of SDK function?

Postby Neosoft Support » Mon Jul 08, 2013 11:37 am

I can confirm that if you delete all of the code in the editor and click OK, nbInterface returns False which is not correct. A fix will require an update to NeoBook. Unfortunately, updating NeoBook (and all the foreign language versions) takes quite a bit of time, so I don't think it's worth doing for a minor bug like this. Maybe you can include a button in your wizard to clear the code without going through the editor?

I apologize for the inconvenience.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: Bug of SDK function?

Postby HPW » Mon Jul 08, 2013 1:06 pm

As posted above I also see it as a big Problem.
So my vote to put the resources into future neobook Releases.
(And that might fix this minor bug)
Hans-Peter
User avatar
HPW
 
Posts: 2521
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: Bug of SDK function?

Postby Peter » Mon Jul 08, 2013 2:15 pm

Hi, Neosoft!

You should not apologize for such trifles like this bug!
This bug is not fateful problem, and we may wait as much as needed.

Many thanks for your support!
User avatar
Peter
 
Posts: 29
Joined: Thu Sep 27, 2012 4:41 pm
Location: St.Petersburg, Russia


Return to PlugIn Discussions

Who is online

Users browsing this forum: Bing [Bot] and 3 guests