UPDATE: Limit for Number of Methods in a Single Plugin?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

UPDATE: Limit for Number of Methods in a Single Plugin?

Martin Marris
Hi again,

OK I figured it out, with a few tests. The problem was *not* caused by "too
many Methods" but by the fact that the last Method I added contained an
ampersand in its name, something like this:

MyMethod&His

This causes the entire plugin to disappear from the Plugins menu and makes
it un-editable using the Plugin Editor (I confirmed this by writing a test
plugin that contained only one method, using an ampersand in the name).

It was silly of me to try using *any* special character in a Method's name I
suppose!

I was able to fix it by opening the plugin in a text editor and deleting the
ampersand (both in the Method header and in the text of the Run method).

Best,

Martin


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://avid-listsrv1.avid.com/mailman/listinfo/plugin-dev
Reply | Threaded
Open this post in threaded view
|

Re: UPDATE: Limit for Number of Methods in a Single Plugin?

Bob Zawalich
As far as I know there is no limit on the number of methods.

However, it is very easy to produce what you have seen if you edit a plugin
in an external editor and use double quotes in code such as

if (a = "Martin")

If you are editing a routine in a text file, then double quotes are used as
method delimiters and global data delimiters. Getting the balance wrong
makes everything disappear.

So it appears that an & might also cause a problem. Hard to tell if there
are others that cause problems. I try to avoid special characters as much as
I  can.

So I never do a lot of work in a text editor on an entire file. I will use
the editor for find and replace operations and shifting by tab levels, but
if I do a lot of new text I am almost guaranteed to  find nothing when I
load it, and then have to painfully reconstruct what I had done to get
things back.

I often take the code from a single method and edit it in an editor, and
then paste it back; that avoids the double quote issue and also means I do
not need to restart Sib to run the plugin.

Beware also any user input (edit boxes) that might contain special
characters, including double quotes. If a plugin crashes and the user Oks
the plugin editor that comes up, an errant double quote can be saved in the
plugin file and make it unusable.

I assume that people know that you cannot use double quotes directly in text
output from a plugin. You can use Chr(34) for that purpose, combining it
with other text.

Bob

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Martin Marris
Sent: Tuesday, July 28, 2015 7:49 AM
To: 'A mailing list for Sibelius plug-in developers'
Subject: [Plugin-dev] UPDATE: Limit for Number of Methods in a Single
Plugin?

Hi again,

OK I figured it out, with a few tests. The problem was *not* caused by "too
many Methods" but by the fact that the last Method I added contained an
ampersand in its name, something like this:

MyMethod&His

This causes the entire plugin to disappear from the Plugins menu and makes
it un-editable using the Plugin Editor (I confirmed this by writing a test
plugin that contained only one method, using an ampersand in the name).

It was silly of me to try using *any* special character in a Method's name I
suppose!

I was able to fix it by opening the plugin in a text editor and deleting the
ampersand (both in the Method header and in the text of the Run method).

Best,

Martin


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://avid-listsrv1.avid.com/mailman/listinfo/plugin-dev

_______________________________________________
Plugin-dev mailing list
[hidden email]
http://avid-listsrv1.avid.com/mailman/listinfo/plugin-dev
Reply | Threaded
Open this post in threaded view
|

Re: UPDATE: Limit for Number of Methods in a Single Plugin?

Martin Marris
Thanks Bob.

I think the basic mistake I made was to use a character in a Method name
that is also an operator in Manuscript.

This is the first time I've had to resort to an external text editor to fix
a broken plugin ... but at least I know how to do it now.

Martin


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://avid-listsrv1.avid.com/mailman/listinfo/plugin-dev