Page 1 of 1

Bug of SDK function?

PostPosted: Tue Jul 02, 2013 11:23 am
by Peter
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

Re: Bug of SDK function?

PostPosted: Tue Jul 02, 2013 12:53 pm
by HPW
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

Re: Bug of SDK function?

PostPosted: Tue Jul 02, 2013 1:34 pm
by Peter
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!

Re: Bug of SDK function?

PostPosted: Tue Jul 02, 2013 2:09 pm
by Neosoft Support
Yes, you have to check the value returned by nbInterface to know if the the data returned is valid.

Re: Bug of SDK function?

PostPosted: Tue Jul 02, 2013 2:15 pm
by Peter
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!

Re: Bug of SDK function?

PostPosted: Tue Jul 02, 2013 2:19 pm
by Peter
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!

Re: Bug of SDK function?

PostPosted: Tue Jul 02, 2013 4:52 pm
by Peter
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...

Re: Bug of SDK function?

PostPosted: Fri Jul 05, 2013 10:19 am
by Neosoft Support
Can you post the code you're using? Is it Delphi?

Re: Bug of SDK function?

PostPosted: Fri Jul 05, 2013 12:05 pm
by HPW
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

Re: Bug of SDK function?

PostPosted: Fri Jul 05, 2013 4:37 pm
by Peter
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

Re: Bug of SDK function?

PostPosted: Mon Jul 08, 2013 11:37 am
by Neosoft Support
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.

Re: Bug of SDK function?

PostPosted: Mon Jul 08, 2013 1:06 pm
by HPW
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)

Re: Bug of SDK function?

PostPosted: Mon Jul 08, 2013 2:15 pm
by Peter
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!