Jump to content

CustTool does not return to None Class


SIDUG

Recommended Posts

Good morning to all:

I have a custom tool script that execute text command. Unlike my other scripts, after execution it doesn't return to the previous class 'None'. i.e. it will stay in ''A Note' class. That creates a bit of problem since some of the objects I create after that would be in a class which I don't want. I know I can try to remember to manually switch back to 'None' but why is it not acting like my other scripts? Much appreciation for a solution.

Procedure CustTool;

VAR

Name:STRING;

Result:BOOLEAN;

BEGIN

PushAttrs;

FillFore(32);

FillBack(0);

FillPat(1);

PenFore(257);

PenBack(0);

PenPat(2);

TextFont(50);

TextSize(9);

TextFace([]);

TextSpace(2);

TextJust(1);

NameClass('A NOTE');

SetTool(-200);

PopAttrs;

END;

Run(CustTool);

best regards

Sidug

Link to comment

Could it be that the call to the text tool doesn't return you to the plugin script after the task appears finished? resulting in the PopAttrs; not being executed. I think you need to use CallTool(); instead of SetTool();

You could test this in one of two ways. By sending a Message('positive progress');

to yourself after the SetTool(); statement. If it doesn't pop up and you need to use SetTool(); you'll need to approach the task in a different manner.

Another way to specifically deal with the active class setting is by capturing the active class at the start and resetting it at the end of the script.

VAR

activeClName:STRING;

BEGIN

PushAttrs;

activeClName:= ActiveClass;

{the PIO script}

PopAttrs;

NameClass(activeClName);

END;

Larry

Edited by LarryO
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...