Page 1 of 1

How do I use imported subroutines in sequencer?

Posted: Tue May 23, 2023 3:26 am
by lowenthalm
How do I use imported subroutines in the sequence editor? I am missing something, I am sure. Here goes the problem:

Here is the script:
SEQUENCE
IMPORT SUBS FROM "\\Mac\Home\Desktop\SharpCap Captures\__Sharpcap Sequences\test2.scs"
GOSUB ""
END SEQUENCE

and here is "test2.scs":
SEQUENCE
DEF SUB WaitAMoment
COUNTDOWN FOR 10 SHOWING "Please Wait..."
END SUB
END SEQUENCE

When I test the import step, or run it in the sequence editor, it appears to do the import without a problem (but gets an error when it hits GOSUB). However, the pull-down menu for GOSUB in the sequence editor is never populated with anything I can select in the sequence editor. I have tried everything I can think of to get the sequence editor to "import" the subroutines so I can select them in the pull-down, but nothing works. Docs aren't illuminating on this issue either.

To make sure the subroutines are callable I saved the script and then edited it in a text editor to be:
SEQUENCE
IMPORT SUBS FROM "\\Mac\Home\Desktop\SharpCap Captures\__Sharpcap Sequences\test2.scs"
GOSUB WaitAMoment
END SEQUENCE

I loaded this into the sequence editor, and it executed as expected, calling the subroutine and displaying the countdown.

Re: How do I use imported subroutines in sequencer?

Posted: Tue May 23, 2023 2:40 pm
by admin
Ah,

that looks like my mistake...

When I added subroutines there was no 'import', so I made it so you cannot manually edit the subroutine name when calling one (it avoids errors from mis-typing, etc). Then I forgot to make the name editable when I added the import step.

You should be able to work around it by editing the SCS file manually and putting in the subroutine name. I will fix the problem in the next SharpCap 4.1 update.

cheers,

Robin