How do I use imported subroutines in sequencer?

Somewhere to ask questions about the best way to use SharpCap
Forum rules
‍

If you have a problem or question, please check the FAQ to see if it already has an answer : https://www.sharpcap.co.uk/sharpcap-faqs
Post Reply
lowenthalm
Posts: 224
Joined: Mon May 07, 2018 12:27 am

How do I use imported subroutines in sequencer?

#1

Post 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.
User avatar
admin
Site Admin
Posts: 17492
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: How do I use imported subroutines in sequencer?

#2

Post 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
Post Reply